diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2012-10-10 12:34:00 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2012-10-10 12:34:00 +0000 |
commit | b9de15c8907c5469eb05aca7bbb5bde293950de3 (patch) | |
tree | c9df2552606039b3bc4f83a935ddd27bb0b576d1 | |
parent | 1e5f142870e048b69d0e4cc148324a5998934e23 (diff) |
check the length of command string
git-svn-id: svn://tug.org/texlive/trunk@27938 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/lib/texmfmp.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c index 51f4d8692da..fc4563c43b7 100644 --- a/Build/source/texk/web2c/lib/texmfmp.c +++ b/Build/source/texk/web2c/lib/texmfmp.c @@ -449,11 +449,11 @@ shell_cmd_is_allowed (const char *cmd, char **safecmd, char **cmdname) { char *p, *q, *r; p = *safecmd; - if (p[1] == ':' && !IS_DIR_SEP (p[2])) { + if (strlen (p) > 2 && p[1] == ':' && !IS_DIR_SEP (p[2])) { q = xmalloc (strlen (p) + 2); q[0] = p[0]; q[1] = p[1]; - q[2] = '\\'; + q[2] = '/'; q[3] = '\0'; strcat (q, (p + 2)); free (*safecmd); diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c index f0e7f4a22e0..4b643e61c05 100644 --- a/Build/source/texk/web2c/luatexdir/luatex.c +++ b/Build/source/texk/web2c/luatexdir/luatex.c @@ -353,7 +353,7 @@ int shell_cmd_is_allowed(const char *cmd, char **safecmd, char **cmdname) { char *p, *q, *r; p = *safecmd; - if (p[1] == ':' && !IS_DIR_SEP (p[2])) { + if (strlen (p) > 2 && p[1] == ':' && !IS_DIR_SEP (p[2])) { q = xmalloc (strlen (p) + 2); q[0] = p[0]; q[1] = p[1]; |