Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-09-26 12:45:24 +0400
committerCorinna Vinschen <corinna@vinschen.de>2003-09-26 12:45:24 +0400
commit0a0a45e22a1f97ac834f757b09fef4b985cee99d (patch)
treed2d04e59210bb13b3d73991e264fff25c7d42d04 /winsup/cygwin
parent8ff4b3513dc5d8c4255e2924222a4cbaa21bbeb2 (diff)
* spawn.cc (spawn_guts): Set errno to E2BIG if command line is
longer than CreateProcess allows (32K).
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/spawn.cc7
2 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0a2fff398..b0c3d7540 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 30d1dd749..ce61c22d5 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -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;