mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-09 22:13:09 +02:00
626912ac05
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21186 3c298f89-4303-0410-b956-a3cf2f4a3e73
15 lines
441 B
Diff
15 lines
441 B
Diff
--- 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 {
|