summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-30 04:43:46 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-30 04:43:46 +0000
commit86692258b0d9e6800a331d3a24005bf933cdebb0 (patch)
tree49264f70269967af181f4cc621d2a4d411ef671b /win32
parentb79b4492ae8e1d421396b3e6a956b93b4b140886 (diff)
merges r31314 from trunk into ruby_1_9_2.
-- * 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/branches/ruby_1_9_2@31811 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 317792a572..b1984f57fd 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1040,6 +1040,12 @@ CreateChild(const char *cmd, const char *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 = CreateProcess(prog, (char *)cmd, psa, psa,
psa->bInheritHandle, dwCreationFlags, NULL, NULL,