]> sourceware.org Git - newlib-cygwin.git/commitdiff
* environ.cc (build_env): Use "kilo"bytes not "mega"bytes. Return immediately
authorChristopher Faylor <me@cgf.cx>
Fri, 16 Sep 2005 20:12:12 +0000 (20:12 +0000)
committerChristopher Faylor <me@cgf.cx>
Fri, 16 Sep 2005 20:12:12 +0000 (20:12 +0000)
on error.
* spawn.cc (spawn_guts): Set return value to -1 on error from build_env.

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

index 617f84a8d8b24dbdf790d858805cf73d4cb3f177..36f1a196cd318a33ea65a0395a078cce8de0df68 100644 (file)
@@ -1,3 +1,10 @@
+2005-09-16  Christopher Faylor  <cgf@timesys.com>
+
+       * environ.cc (build_env): Use "kilo"bytes not "mega"bytes.  Return
+       immediately on error.
+       * spawn.cc (spawn_guts): Set return value to -1 on error from
+       build_env.
+
 2005-09-16  Christopher Faylor  <cgf@timesys.com>
 
        * environ.cc (build_env): Clear envblock and return NULL on attempt to
index b73c710a462d83fb7ad966519f3023fee831c1d1..b7ca700eecd30166b8666b6bfe9a05de5ea0c9f2 100644 (file)
@@ -1034,11 +1034,11 @@ build_env (const char * const *envp, char *&envblock, int &envc,
            p = *srcp;          /* Don't worry about it */
 
          len = strlen (p);
-         if (len >= 32 * 1024 * 1024)
+         if (len >= 32 * 1024)
            {
              free (envblock);
              envblock = NULL;
-             break;
+             goto out;
            }
          new_tl += len + 1;    /* Keep running total of block length so far */
 
@@ -1072,6 +1072,7 @@ build_env (const char * const *envp, char *&envblock, int &envc,
                                           of buffer */
     }
 
+out:
   debug_printf ("envp %p, envc %d", newenv, envc);
   return newenv;
 }
index 149a25999f0ca26fd8ec680c21a3a90873b78136..503fad148e8cdb41acc4282dbd4f1d90d36bb53c 100644 (file)
@@ -627,6 +627,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
   if (!moreinfo->envp || !envblock)
     {
       set_errno (E2BIG);
+      res = -1;
       goto out;
     }
   ciresrv.set (chtype, real_path.iscygexec ());
This page took 0.035785 seconds and 5 git commands to generate.