* spawn.cc (spawn_guts): Set errno to E2BIG if command line is

longer than CreateProcess allows (32K).
This commit is contained in:
Corinna Vinschen
2003-09-26 08:45:24 +00:00
parent 8ff4b3513d
commit 0a0a45e22a
2 changed files with 12 additions and 0 deletions

View File

@ -587,6 +587,13 @@ spawn_guts (const char * prog_arg, const char *const *argv,
else
one_line.add ("", 1);
MALLOC_CHECK;
if (one_line.ix > 32767)
{
debug_printf ("Command line too long (>32K), return E2BIG");
set_errno (E2BIG);
return -1;
}
}
char *envblock;