diff options
author | 2015-07-14 16:16:07 +0000 | |
---|---|---|
committer | 2015-07-14 16:16:07 +0000 | |
commit | 0f715a8c75904a516734aa7541a8b9851e2bc83a (patch) | |
tree | b8d106cb54d6feed890809ef897072d2bf81cd53 /usr.bin/find/misc.c | |
parent | clarification from trondd; (diff) | |
download | wireguard-openbsd-0f715a8c75904a516734aa7541a8b9851e2bc83a.tar.xz wireguard-openbsd-0f715a8c75904a516734aa7541a8b9851e2bc83a.zip |
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/misc.c')
-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; } |