]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http: fix setting event on the last tx
authorVictor Julien <victor@inliniac.net>
Thu, 5 Jul 2018 09:43:41 +0000 (11:43 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 13 Jul 2018 07:10:28 +0000 (09:10 +0200)
src/app-layer-htp.c

index 1aa035f512459c870d1806c462ee39bc35760934..604a7b9203764fd07c47bea59ad8023450875972 100644 (file)
@@ -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) {