diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/stdlib/setenv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/setenv.c b/src/lib/libc/stdlib/setenv.c index 2e882cdbe6..89d1e88911 100644 --- a/src/lib/libc/stdlib/setenv.c +++ b/src/lib/libc/stdlib/setenv.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: setenv.c,v 1.11 2009/06/04 20:39:13 millert Exp $ */ | 1 | /* $OpenBSD: setenv.c,v 1.12 2010/06/29 04:09:34 naddy Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 1987 Regents of the University of California. | 3 | * Copyright (c) 1987 Regents of the University of California. |
| 4 | * All rights reserved. | 4 | * All rights reserved. |
| @@ -145,6 +145,10 @@ unsetenv(const char *name) | |||
| 145 | const char *np; | 145 | const char *np; |
| 146 | int offset; | 146 | int offset; |
| 147 | 147 | ||
| 148 | if (!name || !*name) { | ||
| 149 | errno = EINVAL; | ||
| 150 | return (-1); | ||
| 151 | } | ||
| 148 | for (np = name; *np && *np != '='; ++np) | 152 | for (np = name; *np && *np != '='; ++np) |
| 149 | ; | 153 | ; |
| 150 | if (*np) { | 154 | if (*np) { |
