summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,