]> sourceware.org Git - newlib-cygwin.git/commitdiff
* spawn.cc (spawn_guts): Set errno to E2BIG if command line is
authorCorinna Vinschen <corinna@vinschen.de>
Fri, 26 Sep 2003 08:45:24 +0000 (08:45 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 26 Sep 2003 08:45:24 +0000 (08:45 +0000)
longer than CreateProcess allows (32K).

winsup/cygwin/ChangeLog
winsup/cygwin/spawn.cc

index 0a2fff3985e022c27da198bc4094423d89d86087..b0c3d7540dfe43763f4bf5a6350fe7dd2b5b366d 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-26  Corinna Vinschen  <corinna@vinschen.de>
+
+       * spawn.cc (spawn_guts): Set errno to E2BIG if command line is
+       longer than CreateProcess allows (32K).
+
 2003-09-25  Christopher Faylor  <cgf@redhat.com>
 
        * dtable.cc (build_fh_name): Return pointer to a 'nodevice' rather than
index 30d1dd74918d79e1a046e3d18ea3914ba80c5074..ce61c22d547555ae6d30079226a80c1323cbc9bb 100644 (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;
This page took 0.037493 seconds and 5 git commands to generate.