File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/collectors/log2journal Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,12 @@ static inline bool json_parse_array(LOG_JSON_STATE *js) {
513
513
514
514
size_t index = 0 ;
515
515
do {
516
+ const char * s = json_current_pos (js );
517
+ if (* s == ']' ) {
518
+ json_consume_char (js );
519
+ break ;
520
+ }
521
+
516
522
if (!json_key_index_and_push (js , index ))
517
523
return false;
518
524
@@ -524,7 +530,7 @@ static inline bool json_parse_array(LOG_JSON_STATE *js) {
524
530
if (!json_expect_char_after_white_space (js , ",]" ))
525
531
return false;
526
532
527
- const char * s = json_current_pos (js );
533
+ s = json_current_pos (js );
528
534
json_consume_char (js );
529
535
if (* s == ',' ) {
530
536
index ++ ;
@@ -545,6 +551,12 @@ static inline bool json_parse_object(LOG_JSON_STATE *js) {
545
551
json_consume_char (js );
546
552
547
553
do {
554
+ const char * s = json_current_pos (js );
555
+ if (* s == '}' ) {
556
+ json_consume_char (js );
557
+ break ;
558
+ }
559
+
548
560
if (!json_expect_char_after_white_space (js , "\"" ))
549
561
return false;
550
562
@@ -564,7 +576,7 @@ static inline bool json_parse_object(LOG_JSON_STATE *js) {
564
576
if (!json_expect_char_after_white_space (js , ",}" ))
565
577
return false;
566
578
567
- const char * s = json_current_pos (js );
579
+ s = json_current_pos (js );
568
580
json_consume_char (js );
569
581
if (* s == ',' )
570
582
continue ;
You can’t perform that action at this time.
0 commit comments