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:
Jérôme Duval
2022-08-09 20:07:20 +00:00
committed by waddlesplash
parent fe2b6d7706
commit e963cd2723
+1 -1
View File
@@ -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;
}