Set unset_env pointing to a NULL item, to prevent us from walking
authorEric Andersen <andersen@codepoet.org>
Mon, 3 Nov 2003 22:46:14 +0000 (22:46 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 3 Nov 2003 22:46:14 +0000 (22:46 -0000)
off the end of the list and segfaulting.
 -Erik

coreutils/env.c

index d8a76e36467cb5c954c21b04bf5bf426d4d607b8..d8b428561f81289ef3d93a154442decc957ad551 100644 (file)
@@ -62,9 +62,13 @@ extern int env_main(int argc, char** argv)
        char **ep, *p;
        char *cleanenv[1] = { NULL };
        unsigned long opt;
-       llist_t *unset_env;
+       llist_t list, *unset_env;
        extern char **environ;
 
+       list.data = NULL;
+       list.link = NULL;
+       unset_env = &list;
+
        bb_opt_complementaly = "u*";
        bb_applet_long_options = env_long_options;