diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 6 |
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, |