summaryrefslogtreecommitdiff
path: root/usr.bin/find
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-07-14 16:16:08 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-07-14 16:16:08 +0000
commitdaad355dee86ec57dcb3025d94e7fcba8218dd4a (patch)
tree2f1593ed05e0d0b3c7cfc54f5a948ebd2febb086 /usr.bin/find
parent4ea403542075e2195d29bfdd754dbe3ae6d2221d (diff)
In brace_subst() if we realloc() the store, update p so that it
points into the new store, not the old one. From Gregor Best.
Diffstat (limited to 'usr.bin/find')
-rw-r--r--usr.bin/find/misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/find/misc.c b/usr.bin/find/misc.c
index 37e61a9aea0..a13b62b7a0e 100644
--- a/usr.bin/find/misc.c
+++ b/usr.bin/find/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.12 2014/05/18 08:10:00 espie Exp $ */
+/* $OpenBSD: misc.c,v 1.13 2015/07/14 16:16:07 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -65,6 +65,7 @@ brace_subst(char *orig, char **store, char *path, int len)
if (!(newstore = realloc(*store, newlen)))
err(1, NULL);
+ p = (p - *store) + newstore;
*store = newstore;
len = newlen;
}