]> sourceware.org Git - newlib-cygwin.git/commitdiff
* environ.cc (environ_init): Issue an error if GetEnvironmentStrings fails and
authorChristopher Faylor <me@cgf.cx>
Fri, 16 Sep 2005 14:52:32 +0000 (14:52 +0000)
committerChristopher Faylor <me@cgf.cx>
Fri, 16 Sep 2005 14:52:32 +0000 (14:52 +0000)
return.

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

index b79cde5d5f605765de3d127cd221749f5a8405d8..08e0781cd2ccb2890a91203eea792952fe19d808 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-16  Christopher Faylor  <cgf@timesys.com>
+
+       * environ.cc (environ_init): Issue an error if GetEnvironmentStrings
+       fails and return.
+
 2005-09-15  Christopher Faylor  <cgf@timesys.com>
 
        * pinfo.h (EXITCODE_SET): Move out of range of Windows error.
index 37d950ee0f599e18ef05c786340d444342229485..4029cd6244c1cca99dc2da2d850dad7b84c3c5b7 100644 (file)
@@ -752,7 +752,13 @@ environ_init (char **envp, int envc)
 
   /* Allocate space for environment + trailing NULL + CYGWIN env. */
   lastenviron = envp = (char **) malloc ((4 + (envc = 100)) * sizeof (char *));
+
   rawenv = GetEnvironmentStrings ();
+  if (!rawenv)
+    {
+      system_printf ("GetEnvironmentStrings returned NULL, %E");
+      return;
+    }
 
   /* Current directory information is recorded as variables of the
      form "=X:=X:\foo\bar; these must be changed into something legal
This page took 0.036079 seconds and 5 git commands to generate.