]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
reject rules with invalid hex digits in content
authorEileen Donlon <emdonlo@gmail.com>
Tue, 20 Mar 2012 14:59:47 +0000 (10:59 -0400)
committerVictor Julien <victor@inliniac.net>
Thu, 22 Mar 2012 11:41:19 +0000 (12:41 +0100)
src/detect-content.c

index 658341d422c46d2fbff853019dfe374f350b9f90..e264dcdbf04ee3a68ece16191a9c7fc6e8a0d330 100644 (file)
@@ -158,6 +158,11 @@ int DetectContentDataParse(char *keyword, char *contentstr, char** pstr, uint16_
                     } else if (str[i] == ' ') {
                         // SCLogDebug("space as part of binary string");
                     }
+                    else if (str[i] != ',') {
+                        SCLogError(SC_ERR_INVALID_SIGNATURE, "Invalid hex code in "
+                                    "content - %s, hex %c. Invalidating signature", str, str[i]);
+                        goto error;
+                    }
                 } else if (escape) {
                     if (str[i] == ':' ||
                         str[i] == ';' ||