]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
parse/ip: fix potential oob write in ipv4 validation
authorVictor Julien <victor@inliniac.net>
Mon, 15 Apr 2019 12:52:38 +0000 (14:52 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 30 Apr 2019 09:12:28 +0000 (11:12 +0200)
Found using AFL.

src/util-ip.c

index 7b568986fb61553a6e935cc797c49fe179ab4c4f..be127327edeeabb21625d562ce60626e050b3b8a 100644 (file)
@@ -53,7 +53,7 @@ bool IPv4AddressStringIsValid(const char *str)
             dots++;
             alen = 0;
         } else {
-            if (alen >= 4) {
+            if (alen >= 3) {
                 SCLogDebug("too long");
                 return false;
             }