From e963cd27237cd10293bb4658ad47dd3f703b18c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 9 Aug 2022 18:35:12 +0200 Subject: [PATCH] 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 Reviewed-by: waddlesplash --- src/system/libroot/posix/stdlib/env.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/libroot/posix/stdlib/env.cpp b/src/system/libroot/posix/stdlib/env.cpp index bc155f0c55..36cc03b838 100644 --- a/src/system/libroot/posix/stdlib/env.cpp +++ b/src/system/libroot/posix/stdlib/env.cpp @@ -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; }