http: handles gaps

ie data=NULL and len>0 from libhtp callbacks
pull/5346/head
Philippe Antoine 5 years ago committed by Victor Julien
parent 23c0efa2ec
commit d509a78074

@ -1777,7 +1777,7 @@ static int HTPCallbackRequestBodyData(htp_tx_data_t *d)
if (!(SC_ATOMIC_GET(htp_config_flags) & HTP_REQUIRE_REQUEST_BODY))
SCReturnInt(HTP_OK);
if (d->data == NULL || d->len == 0)
if (d->len == 0)
SCReturnInt(HTP_OK);
#ifdef PRINT
@ -1909,7 +1909,7 @@ static int HTPCallbackResponseBodyData(htp_tx_data_t *d)
if (!(SC_ATOMIC_GET(htp_config_flags) & HTP_REQUIRE_RESPONSE_BODY))
SCReturnInt(HTP_OK);
if (d->data == NULL || d->len == 0)
if (d->len == 0)
SCReturnInt(HTP_OK);
HtpState *hstate = htp_connp_get_user_data(d->tx->connp);
@ -3093,6 +3093,9 @@ void RegisterHTPParsers(void)
AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_HTTP, STREAM_TOCLIENT,
HTPHandleResponseData);
SC_ATOMIC_INIT(htp_config_flags);
/* This parser accepts gaps. */
AppLayerParserRegisterOptionFlags(
IPPROTO_TCP, ALPROTO_HTTP, APP_LAYER_PARSER_OPT_ACCEPT_GAPS);
AppLayerParserRegisterParserAcceptableDataDirection(IPPROTO_TCP,
ALPROTO_HTTP, STREAM_TOSERVER|STREAM_TOCLIENT);
HTPConfigure();

Loading…
Cancel
Save