mirror of
https://git.busybox.net/busybox
synced 2026-02-05 11:39:06 +00:00
awk: guard against empty environment
This commit is contained in:
parent
e725bfe6e0
commit
f71d916b60
1 changed files with 2 additions and 1 deletions
|
|
@ -2696,7 +2696,8 @@ int awk_main(int argc, char **argv)
|
|||
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue