summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2005-05-25 19:42:10 +1000
committerDarren Tucker <dtucker@zip.com.au>2005-05-25 19:42:10 +1000
commitae8c91ec0749282e220f9c56efee1444a072cf62 (patch)
tree7d544e7e6293b09a5f3b0da181f4e56f978bb40c
parent328118aa798878a68398b92ba85adfb630bc5434 (diff)
- (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory
allocation when retrieving core Windows environment. Add CYGWIN variable to propagated variables. Patch from vinschen at redhat.com, ok djm@
-rw-r--r--ChangeLog5
-rw-r--r--openbsd-compat/bsd-cygwin_util.c7
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a7eab8fc..24605b53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
idea, it is now known as UNSUPPORTED_POSIX_THREADS_HACK. Attempting to use
USE_POSIX_THREADS will now generate an error so we don't silently change
behaviour. ok djm@
+ - (dtucker) [openbsd-compat/bsd-cygwin_util.c] Ensure sufficient memory
+ allocation when retrieving core Windows environment. Add CYGWIN variable
+ to propagated variables. Patch from vinschen at redhat.com, ok djm@
20050524
- (djm) [openbsd-compat/readpassphrase.c] bz #950: Retry tcsetattr to ensure
@@ -2492,4 +2495,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.3758 2005/05/25 06:18:09 dtucker Exp $
+$Id: ChangeLog,v 1.3759 2005/05/25 09:42:10 dtucker Exp $
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index f53abb6e..b5e3cc52 100644
--- a/openbsd-compat/bsd-cygwin_util.c
+++ b/openbsd-compat/bsd-cygwin_util.c
@@ -29,7 +29,7 @@
#include "includes.h"
-RCSID("$Id: bsd-cygwin_util.c,v 1.13 2004/08/30 10:42:08 dtucker Exp $");
+RCSID("$Id: bsd-cygwin_util.c,v 1.14 2005/05/25 09:42:11 dtucker Exp $");
#ifdef HAVE_CYGWIN
@@ -247,6 +247,7 @@ static struct wenv {
{ NL("COMMONPROGRAMFILES=") },
{ NL("COMPUTERNAME=") },
{ NL("COMSPEC=") },
+ { NL("CYGWIN=") },
{ NL("NUMBER_OF_PROCESSORS=") },
{ NL("OS=") },
{ NL("PATH=") },
@@ -260,7 +261,7 @@ static struct wenv {
{ NL("SYSTEMROOT=") },
{ NL("TMP=") },
{ NL("TEMP=") },
- { NL("WINDIR=") },
+ { NL("WINDIR=") }
};
char **
@@ -269,7 +270,7 @@ fetch_windows_environment(void)
char **e, **p;
int i, idx = 0;
- p = xmalloc(WENV_SIZ * sizeof(char *));
+ p = xmalloc((WENV_SIZ + 1) * sizeof(char *));
for (e = environ; *e != NULL; ++e) {
for (i = 0; i < WENV_SIZ; ++i) {
if (!strncmp(*e, wenv_arr[i].name, wenv_arr[i].namelen))