From 4cffd5aaa32d364cec6dcbfa7ee54816e8ef6fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Fri, 7 Jul 2017 22:41:12 +0200 Subject: [PATCH] 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 --- src/unix/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/core.c b/src/unix/core.c index 4c744925..a0513451 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -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; -- 2.13.2