diff options
author | tjr <tjr@FreeBSD.org> | 2002-10-08 11:22:49 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-10-08 11:22:49 +0000 |
commit | 33d1a8b9c2dbe4bc22843213ff3044d86bb37710 (patch) | |
tree | ca04efa366286bf2ecbc3dd250f40bef3ebcd13c /bin/sh | |
parent | ecc00e796caa335a30f92a49f25e5f2b67fda730 (diff) | |
download | FreeBSD-src-33d1a8b9c2dbe4bc22843213ff3044d86bb37710.zip FreeBSD-src-33d1a8b9c2dbe4bc22843213ff3044d86bb37710.tar.gz |
Do not strip CTL* escapes from redirection filenames in argstr(); they
are later stripped with rmescapes() in expandarg(). If the filename has
already been unescaped, doing it again in rmescapes() can walk off the
end of the string, leading to memory corruption and eventually SIGSEGV.
Noticed by: kris
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/expand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c index a8cad11..73cedc0 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -213,7 +213,7 @@ STATIC void argstr(char *p, int flag) { char c; - int quotes = flag & (EXP_FULL | EXP_CASE); /* do CTLESC */ + int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); /* do CTLESC */ int firsteq = 1; if (*p == '~' && (flag & (EXP_TILDE | EXP_VARTILDE))) |