Skip to content

Commit 0dd498b

Browse files
qbx2edsiper
authored andcommitted
out_kafka: fix segmentation fault issue while produce_message
Signed-off-by: Yop Lee <[email protected]>
1 parent fb63425 commit 0dd498b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugins/out_kafka/kafka.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,14 @@ static void cb_kafka_flush(struct flb_event_chunk *event_chunk,
478478
while (msgpack_unpack_next(&result,
479479
event_chunk->data,
480480
event_chunk->size, &off) == MSGPACK_UNPACK_SUCCESS) {
481+
if (result.data.type != MSGPACK_OBJECT_ARRAY) {
482+
continue;
483+
}
484+
485+
if (result.data.via.array.size != 2) {
486+
continue;
487+
}
488+
481489
flb_time_pop_from_msgpack(&tms, &result, &obj);
482490

483491
ret = produce_message(&tms, obj, ctx, config);

0 commit comments

Comments
 (0)