From: Victor Julien Date: Mon, 3 Sep 2012 09:30:19 +0000 (+0200) Subject: Make sure we never underflow len in DetectLoadSigFile X-Git-Tag: suricata-1.4beta1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d27518bbd8343094188bdd81d40c0439f658243;p=thirdparty%2Fsuricata.git Make sure we never underflow len in DetectLoadSigFile --- diff --git a/src/detect.c b/src/detect.c index 8e70d83520..67104d72ca 100644 --- a/src/detect.c +++ b/src/detect.c @@ -526,7 +526,7 @@ int DetectLoadSigFile(DetectEngineCtx *de_ctx, char *sig_file, int *sigs_tot) { continue; /* Check for multiline rules. */ - while (isspace(line[--len])); + while (len > 0 && isspace(line[--len])); if (line[len] == '\\') { multiline++; offset = len;