]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: fix read overflow in DetectGetLastSMByListId
authorPhilippe Antoine <contact@catenacyber.fr>
Thu, 23 Jul 2020 11:28:57 +0000 (13:28 +0200)
committerJeff Lucovsky <jeff@lucovsky.org>
Sat, 19 Sep 2020 14:20:57 +0000 (10:20 -0400)
(cherry picked from commit 5c31383d1c9ecbd93f0eae4ef02ae17ff98bcbed)

src/detect-parse.c

index f559f826b54ac6e831ddfccb776561b2bb434cd5..00e0eca0daaf2bf60647e9b512e30d60014f03d6 100644 (file)
@@ -543,6 +543,9 @@ SigMatch *DetectGetLastSMByListId(const Signature *s, int list_id, ...)
     SigMatch *sm_new;
     int sm_type;
 
+    if ((uint32_t)list_id >= s->init_data->smlists_array_size) {
+        return NULL;
+    }
     SigMatch *sm_list = s->init_data->smlists_tail[list_id];
     if (sm_list == NULL)
         return NULL;