putenv: handles a string starting with = as error
Change-Id: I1ff288080ac468b5f8a75f2064e68e8086dc7a69 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5539 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
fe2b6d7706
commit
e963cd2723
@@ -309,7 +309,7 @@ putenv(char *string)
|
||||
char *value = strchr(string, '=');
|
||||
status_t status;
|
||||
|
||||
if (value == NULL) {
|
||||
if (value == NULL || value == string) {
|
||||
__set_errno(B_BAD_VALUE);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user