Skip to content

Commit 74a21b1

Browse files
authored
pack: fix heap-double-free in flb_pack_state_reset (fluent#5883)
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45978 Signed-off-by: Aleks L <[email protected]>
1 parent 676a26b commit 74a21b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/flb_pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,13 @@ int flb_pack_state_init(struct flb_pack_state *s)
333333
void flb_pack_state_reset(struct flb_pack_state *s)
334334
{
335335
flb_free(s->tokens);
336+
s->tokens = NULL;
336337
s->tokens_size = 0;
337338
s->tokens_count = 0;
338339
s->last_byte = 0;
339340
s->buf_size = 0;
340341
flb_free(s->buf_data);
342+
s->buf_data = NULL;
341343
}
342344

343345

0 commit comments

Comments
 (0)