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.0.5~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a6ff8776115395d3650280efa2227e7227b2b34;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 20bddd9b47..8bcc770a53 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -249,6 +249,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) {