From: Victor Julien Date: Thu, 5 Jul 2018 09:43:41 +0000 (+0200) Subject: http: fix setting event on the last tx X-Git-Tag: suricata-4.1.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83e7ddf41f7d50fc0802b32ee9c1b99aa9eab04f;p=thirdparty%2Fsuricata.git http: fix setting event on the last tx --- diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 1aa035f512..604a7b9203 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -250,6 +250,8 @@ static void HTPSetEvent(HtpState *s, HtpTxUserData *htud, uint8_t e) } htp_tx_t *tx = HTPStateGetTx(s, s->transaction_cnt); + if (tx == NULL && s->transaction_cnt > 0) + tx = HTPStateGetTx(s, s->transaction_cnt - 1); if (tx != NULL) { htud = (HtpTxUserData *) htp_tx_get_user_data(tx); if (htud != NULL) {