diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-07-14 16:16:08 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-07-14 16:16:08 +0000 |
commit | daad355dee86ec57dcb3025d94e7fcba8218dd4a (patch) | |
tree | 2f1593ed05e0d0b3c7cfc54f5a948ebd2febb086 /usr.bin/find | |
parent | 4ea403542075e2195d29bfdd754dbe3ae6d2221d (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.c | 3 |
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; } |