mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 14:13:16 +00:00
14fe6e0238
SVN-Revision: 21186
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 {
|