Skip to content

Commit

Permalink
* win32/win32.c (CreateChild): maximum length of lpCommandLine is
Browse files Browse the repository at this point in the history
	  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
  • Loading branch information
tarui committed Apr 20, 2011
1 parent e8d5304 commit 6825f77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Thu Apr 21 01:01:28 2011 Masaya Tarui <[email protected]>

* 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 <[email protected]>

* ext/date/date_strptime.c (date__strptime_internal): do not
Expand Down
6 changes: 6 additions & 0 deletions win32/win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6825f77

Please sign in to comment.