summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-20 16:15:35 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-20 16:15:35 +0000
commit6825f77323fd140d8cf8d407eed2fccbfec5e298 (patch)
tree8056f120eb2619446a3fcb7d775b856e129b446d /win32
parente8d5304080fb4bdfbad6005089fcf14b6850aae8 (diff)
* win32/win32.c (CreateChild): maximum length of lpCommandLine is
32,768 characters, including the Unicode terminating null character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 5aea1b5e78..6dafecb079 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1060,6 +1060,12 @@ CreateChild(const WCHAR *cmd, const WCHAR *prog, SECURITY_ATTRIBUTES *psa,
dwCreationFlags = (NORMAL_PRIORITY_CLASS);
+ if (lstrlenW(cmd) > 32767) {
+ child->pid = 0; /* release the slot */
+ errno = E2BIG;
+ return NULL;
+ }
+
RUBY_CRITICAL({
fRet = CreateProcessW(prog, (WCHAR *)cmd, psa, psa,
psa->bInheritHandle, dwCreationFlags, NULL, NULL,