fix for setenv bogus var argument handling
thanks to mikachu per POSIX: The setenv() function shall fail if: [EINVAL] The name argument is a null pointer, points to an empty string, or points to a string containing an '=' character.
This commit is contained in:
parent
e01ac67599
commit
649af9f73a
1 changed files with 1 additions and 1 deletions
2
src/env/setenv.c
vendored
2
src/env/setenv.c
vendored
|
|
@ -9,7 +9,7 @@ int setenv(const char *var, const char *value, int overwrite)
|
||||||
char *s;
|
char *s;
|
||||||
int l1, l2;
|
int l1, l2;
|
||||||
|
|
||||||
if (strchr(var, '=')) {
|
if (!var || !*var || strchr(var, '=')) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue