summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-03-27 19:14:02 +0000
committerChristopher Faylor <me@cgf.cx>2011-03-27 19:14:02 +0000
commitf3e3e0e7eb3f59c4e41506a130f7a97c44bc9470 (patch)
treef863dba55df0e589aba7c00ee82d7c48751311d4
parent623f23351c1b6c47411c52508603d817f9624d4e (diff)
downloadcygnal-f3e3e0e7eb3f59c4e41506a130f7a97c44bc9470.tar.gz
cygnal-f3e3e0e7eb3f59c4e41506a130f7a97c44bc9470.tar.bz2
cygnal-f3e3e0e7eb3f59c4e41506a130f7a97c44bc9470.zip
* dll_init.cc (dll::init): Accommodate ill-behaved dlls who don't fill out
p.envptr.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dll_init.cc5
2 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7df9dc310..51417e14b 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-27 Christopher Faylor <me.cygwin2011@cgf.cx>
+
+ * dll_init.cc (dll::init): Accommodate ill-behaved dlls who don't fill
+ out p.envptr.
+
2011-03-25 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (mmap64): Add a cheat to let a certain autoconf test succeed
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 37f0297f1..122055722 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -76,7 +76,10 @@ dll::init ()
int ret = 1;
/* This should be a no-op. Why didn't we just import this variable? */
- *(p.envptr) = __cygwin_environ;
+ if (!p.envptr)
+ p.envptr = &__cygwin_environ;
+ else
+ *(p.envptr) = __cygwin_environ;
/* Don't run constructors or the "main" if we've forked. */
if (!in_forkee)