openbsd-ports/www/analog/patches/patch-src_utils_c
naddy da0859a09c Fix several out of bounds accesses.
Parts from Wolfgang S. Rupprecht via PR 4175; testing by Sam Smith.
2005-04-18 22:32:36 +00:00

13 lines
486 B
Plaintext

$OpenBSD: patch-src_utils_c,v 1.1 2005/04/18 22:32:36 naddy Exp $
--- src/utils.c.orig Mon Apr 18 21:48:29 2005
+++ src/utils.c Mon Apr 18 21:48:56 2005
@@ -690,7 +690,7 @@ logical wildmatch(char *s, char *p, char
below. */
ss = strchr(s, '\0');
pp = strchr(p, '\0');
- while ((*ss == *pp || *pp == '?') && ss >= s && *pp != '*') {
+ while (ss >= s && *pp != '*' && (*ss == *pp || *pp == '?')) {
ss--; /* pp != p is covered because *p == '*' */
pp--;
}