mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibC: Return EINVAL from unsetenv()
if input is empty or contains "="
This commit is contained in:
parent
d3a27eeaf2
commit
b9e7998b53
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/tcl3
Commit: b9e7998b53
Pull-request: https://github.com/SerenityOS/serenity/pull/19630
1 changed files with 5 additions and 0 deletions
|
@ -431,6 +431,11 @@ char* secure_getenv(char const* name)
|
|||
int unsetenv(char const* name)
|
||||
{
|
||||
auto new_var_len = strlen(name);
|
||||
if (new_var_len == 0 || strchr(name, '=')) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
size_t environ_size = 0;
|
||||
int skip = -1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue