]> granicus.if.org Git - sudo/commitdiff
Avoid a potential out of bounds read found by enh while fuzzing
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 31 Jul 2015 22:10:03 +0000 (16:10 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 31 Jul 2015 22:10:03 +0000 (16:10 -0600)
with address sanitizer enabled.

lib/util/fnmatch.c

index 8861937d48cbad0ecab4796bff5ed596a6ad7d22..18855992d9322f23c642c17034c8d35ebc93cf74 100644 (file)
@@ -188,6 +188,8 @@ static int fnmatch_ch(const char **pattern, const char **string, int flags)
                 result = 0;
                 continue;
             }
+            if (!**pattern)
+                break;
 
 leadingclosebrace:
             /* Look at only well-formed range patterns;