aboutsummaryrefslogtreecommitdiffstats
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
parente8d5304080fb4bdfbad6005089fcf14b6850aae8 (diff)
downloadruby-6825f77323fd140d8cf8d407eed2fccbfec5e298.tar.gz
* 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
-rw-r--r--ChangeLog5
-rw-r--r--win32/win32.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8563299b33..2ffd04b0b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Apr 21 01:01:28 2011 Masaya Tarui <tarui@ruby-lang.org>
+
+ * win32/win32.c (CreateChild): maximum length of lpCommandLine is
+ 32,768 characters, including the Unicode terminating null character.
+
Wed Apr 20 21:32:11 2011 Tadayoshi Funaba <tadf@dotrb.org>
* ext/date/date_strptime.c (date__strptime_internal): do not
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,