Skip to content

Commit 47bdc62

Browse files
committed
gzip: Handle insufiicient data length case explicitly
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent fe55e04 commit 47bdc62

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/flb_gzip.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,9 +690,11 @@ static int flb_gzip_decompressor_process_header(
690690

691691
/* Minimal length: header + crc32 */
692692
if (context->input_buffer_length < FLB_GZIP_HEADER_SIZE) {
693-
flb_error("[gzip] unexpected content length");
694-
695-
return FLB_DECOMPRESSOR_FAILURE;
693+
/*
694+
* This is not a fatal error; it's the expected condition when waiting
695+
* for more data. Return INSUFFICIENT_DATA without logging an error.
696+
*/
697+
return FLB_DECOMPRESSOR_INSUFFICIENT_DATA;
696698
}
697699

698700
memcpy(&inner_context->gzip_header,

0 commit comments

Comments
 (0)