Skip to content

Commit 437f757

Browse files
catenacybervictorjulien
authored andcommitted
response: do not error on gap finishing content-length
Passing a gap to a decompressor closes it, but if we also finish known content-length, we try to reclose decompressor and fail
1 parent 91c0334 commit 437f757

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

htp/htp_transaction.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,13 @@ htp_status_t htp_tx_res_process_body_data_ex(htp_tx_t *tx, const void *data, siz
972972
case HTP_COMPRESSION_DEFLATE:
973973
case HTP_COMPRESSION_LZMA:
974974
// In severe memory stress these could be NULL
975-
if (tx->connp->out_decompressor == NULL)
975+
if (tx->connp->out_decompressor == NULL) {
976+
if (data == NULL) {
977+
// we were already stopped on a gap finishing CL
978+
return HTP_OK;
979+
}
976980
return HTP_ERROR;
981+
}
977982

978983
struct timeval after;
979984
gettimeofday(&tx->connp->out_decompressor->time_before, NULL);

0 commit comments

Comments
 (0)