diff options
| author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-11-03 22:46:14 +0000 |
|---|---|---|
| committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-11-03 22:46:14 +0000 |
| commit | 2291e0786504fa5a2e3ab28be3e69b5e2758ab91 (patch) | |
| tree | 338f37d2efdf77b6b135a935f54cadbb90dc837a /coreutils | |
| parent | 3b2c5e38dc4b7ec6ea1588841d6654606a5a502d (diff) | |
| download | busybox-w32-2291e0786504fa5a2e3ab28be3e69b5e2758ab91.tar.gz busybox-w32-2291e0786504fa5a2e3ab28be3e69b5e2758ab91.tar.bz2 busybox-w32-2291e0786504fa5a2e3ab28be3e69b5e2758ab91.zip | |
Set unset_env pointing to a NULL item, to prevent us from walking
off the end of the list and segfaulting.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@7766 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/env.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/env.c b/coreutils/env.c index d8a76e364..d8b428561 100644 --- a/coreutils/env.c +++ b/coreutils/env.c | |||
| @@ -62,9 +62,13 @@ extern int env_main(int argc, char** argv) | |||
| 62 | char **ep, *p; | 62 | char **ep, *p; |
| 63 | char *cleanenv[1] = { NULL }; | 63 | char *cleanenv[1] = { NULL }; |
| 64 | unsigned long opt; | 64 | unsigned long opt; |
| 65 | llist_t *unset_env; | 65 | llist_t list, *unset_env; |
| 66 | extern char **environ; | 66 | extern char **environ; |
| 67 | 67 | ||
| 68 | list.data = NULL; | ||
| 69 | list.link = NULL; | ||
| 70 | unset_env = &list; | ||
| 71 | |||
| 68 | bb_opt_complementaly = "u*"; | 72 | bb_opt_complementaly = "u*"; |
| 69 | bb_applet_long_options = env_long_options; | 73 | bb_applet_long_options = env_long_options; |
| 70 | 74 | ||
