]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Coverity 1038111: fix local overrun of a string in app layer proto detect setup code.
authorVictor Julien <victor@inliniac.net>
Mon, 16 Sep 2013 13:26:49 +0000 (15:26 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 16 Sep 2013 13:34:40 +0000 (15:34 +0200)
src/detect-content.c

index e2d1a95dec7e3af5899d495a636e695b75855eed..c124c44ff184f714d017d507797dce1a1ee4c6e4 100644 (file)
@@ -270,7 +270,7 @@ DetectContentData *DetectContentParse (char *contentstr)
 
 DetectContentData *DetectContentParseEncloseQuotes(char *contentstr)
 {
-    char str[strlen(contentstr) + 2];
+    char str[strlen(contentstr) + 3]; // 2 for quotes, 1 for \0
 
     str[0] = '\"';
     memcpy(str + 1, contentstr, strlen(contentstr));