unix: check for NULL in uv_os_unsetenv for parameter name
Fixes segfault of unit test on musl (AlpineLinux). Add a check for parameter like uv_os_setenv do. PR-URL: https://github.com/libuv/libuv/pull/1409 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
parent
d63030b0ba
commit
ad1c828827
@ -1292,6 +1292,9 @@ int uv_os_setenv(const char* name, const char* value) {
|
||||
|
||||
|
||||
int uv_os_unsetenv(const char* name) {
|
||||
if (name == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
if (unsetenv(name) != 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user