svn commit: trunk/busybox/editors

vda at busybox.net vda at busybox.net
Thu May 3 22:57:56 UTC 2007


Author: vda
Date: 2007-05-03 15:57:56 -0700 (Thu, 03 May 2007)
New Revision: 18552

Log:
awk: guard against empty environment



Modified:
   trunk/busybox/editors/awk.c


Changeset:
Modified: trunk/busybox/editors/awk.c
===================================================================
--- trunk/busybox/editors/awk.c	2007-05-03 22:45:39 UTC (rev 18551)
+++ trunk/busybox/editors/awk.c	2007-05-03 22:57:56 UTC (rev 18552)
@@ -2696,7 +2696,8 @@
 	newfile("/dev/stdout")->F = stdout;
 	newfile("/dev/stderr")->F = stderr;
 
-	for (envp = environ; *envp; envp++) {
+	/* Huh, people report that sometimes environ is NULL. Oh well. */
+	if (environ) for (envp = environ; *envp; envp++) {
 		char *s = xstrdup(*envp);
 		char *s1 = strchr(s, '=');
 		if (s1) {




More information about the busybox-cvs mailing list