1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-09-19 12:22:26 +03:00
openwrt-xburst/package/busybox/patches/000-upstream-ash.patch

15 lines
441 B
Diff
Raw Normal View History

--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5424,7 +5424,11 @@ rmescapes(char *str, int flag)
size_t fulllen = len + strlen(p) + 1;
if (flag & RMESCAPE_GROW) {
+ int strloc = str - (char *)stackblock();
r = makestrspace(fulllen, expdest);
+ /* p and str may be invalidated by makestrspace */
+ str = (char *)stackblock() + strloc;
+ p = str + len;
} else if (flag & RMESCAPE_HEAP) {
r = ckmalloc(fulllen);
} else {