summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2015-08-01 18:11:08 +0000
committermillert <millert@openbsd.org>2015-08-01 18:11:08 +0000
commit25963ebf8d037aaedfdb78fd573022dc88343ea0 (patch)
treeba9e168fdf0974962e33253f6f356ac3ea1897c3
parent- Be more specific as to what accept as answer to the "Allow root (diff)
downloadwireguard-openbsd-25963ebf8d037aaedfdb78fd573022dc88343ea0.tar.xz
wireguard-openbsd-25963ebf8d037aaedfdb78fd573022dc88343ea0.zip
Fix a potential out-of-bounds read found via address-sanitizer while
fuzzing as reported by Elliott Hughes. OK doug@ stsp@
-rw-r--r--lib/libc/gen/fnmatch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index e83dc43c282..0d0f18ff434 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fnmatch.c,v 1.18 2014/12/11 16:25:34 millert Exp $ */
+/* $OpenBSD: fnmatch.c,v 1.19 2015/08/01 18:11:08 millert Exp $ */
/* Copyright (c) 2011, VMware, Inc.
* All rights reserved.
@@ -192,6 +192,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;