]> 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>
Mon, 16 Jul 2018 11:30:50 +0000 (13:30 +0200)
src/app-layer-htp.c

index 20bddd9b470f0f5212ab789c3b4a67d78a338bed..8bcc770a53585e2750fbba5569b9f020a944435d 100644 (file)
@@ -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) {