Skip to content

Commit 47c9f9a

Browse files
committed
[scan_json] handle invalid line when there is a cutoff
1 parent 3e397d0 commit 47c9f9a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/log_format.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ external_log_format::scan_json(std::vector<logline>& dst,
18671867
line_count = msg_frag.count('\n') + 1;
18681868
yajl_free_error(handle, msg);
18691869
}
1870-
if (!this->lf_specialized) {
1870+
if (!this->lf_specialized || dst.empty()) {
18711871
return scan_no_match{"JSON parsing failed"};
18721872
}
18731873
for (int lpc = 0; lpc < line_count; lpc++) {

0 commit comments

Comments
 (0)