From: Victor Julien Date: Tue, 4 Mar 2014 08:55:59 +0000 (+0100) Subject: Coverity fix X-Git-Tag: suricata-2.0rc2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=684d7875677a0f9ec4cf3bd71afe81bdfd6f3110;p=thirdparty%2Fsuricata.git Coverity fix Coverity 992695, fix potential array index with negative int. Very unlikely case at rule keyword parsing stage. --- diff --git a/src/detect-byte-extract.c b/src/detect-byte-extract.c index 9eae71eb78..d5976992a4 100644 --- a/src/detect-byte-extract.c +++ b/src/detect-byte-extract.c @@ -679,6 +679,8 @@ int DetectByteExtractSetup(DetectEngineCtx *de_ctx, Signature *s, char *arg) sm_list = DETECT_SM_LIST_PMATCH; } else { sm_list = SigMatchListSMBelongsTo(s, prev_pm); + if (sm_list < 0) + goto error; if (sm_list != DETECT_SM_LIST_PMATCH) s->flags |= SIG_FLAG_APPLAYER; }