From: Philippe Antoine Date: Thu, 23 Jul 2020 11:28:57 +0000 (+0200) Subject: detect: fix read overflow in DetectGetLastSMByListId X-Git-Tag: suricata-6.0.0-beta1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c31383d1c9ecbd93f0eae4ef02ae17ff98bcbed;p=thirdparty%2Fsuricata.git detect: fix read overflow in DetectGetLastSMByListId --- diff --git a/src/detect-parse.c b/src/detect-parse.c index 03205a8f0d..08a1e85196 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -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;