mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +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 {
|