Skip to content

Commit e97f611

Browse files
committed
input_log: fix context handling edge cases
This patch fixes edge cases and improves robustness in context extraction and handling. Signed-off-by: Eduardo Silva <[email protected]>
1 parent 2d07323 commit e97f611

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/flb_input_log.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,8 @@ static int build_payload_for_default_route(struct flb_input_instance *ins,
487487
size_t record_count,
488488
uint8_t *matched_non_default)
489489
{
490-
size_t i;
490+
int i;
491+
int j;
491492
int matched;
492493
int ret;
493494
int condition_result;
@@ -599,7 +600,7 @@ static int build_payload_for_default_route(struct flb_input_instance *ins,
599600
flb_log_event_encoder_destroy(encoder);
600601
return -1;
601602
}
602-
for (size_t j = i + 1; j < record_count; j++) {
603+
for (j = i + 1; j < record_count; j++) {
603604
if (flb_log_event_decoder_get_record_type(&records[j]->event, &record_type) == 0 &&
604605
record_type == FLB_LOG_EVENT_GROUP_END &&
605606
records[j]->cobj_group_metadata == group_start_record->cobj_group_metadata) {

0 commit comments

Comments
 (0)