Skip to content

Commit 876d6e8

Browse files
bpetermannS11edsiper
authored andcommitted
out_gelf: fix crash after missing short_message key
Fix for an illegal free in the gelf output plugin when it handled a message lacking the short_message key. In `cb_gelf_flush`: if the input doesn't contain the short_message key `flb_msgpack_to_gelf` will fail and return NULL. The variable `s` is not initialized, but still `flb_sds_destroy(s)` is called which may unexpectedly free some arbitrary pointer. Fixed by initializing `s`. Fixes #10086
1 parent ed07bc7 commit 876d6e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugins/out_gelf/gelf.c

+1
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ static void cb_gelf_flush(struct flb_event_chunk *event_chunk,
312312
off = log_decoder.offset;
313313
size = off - prev_off;
314314
prev_off = off;
315+
s = NULL;
315316

316317
map = *log_event.body;
317318

0 commit comments

Comments
 (0)