Commit 028194b5 authored by Martin Bark's avatar Martin Bark Committed by Rod Vagg
Browse files

os: fix crash in GetInterfaceAddresses



If uv_interface_addresses() returns UV_ENOSYS then interfaces and count
are uninitialised. This can cause a segmentation fault inside
GetInterfaceAddresses when it tries to use the invalid interfaces[].
Fix the issue by returning from GetInterfaceAddresses on the UV_ENOSYS
error.

This issue was observed when using uCLibc-ng version 1.0.9 because
uv_interface_addresses() in deps/uv/src/unix/linux-core.c incorrectly
undefines HAVE_IFADDRS_H.

Signed-off-by: default avatarMartin Bark <martin@barkynet.com>
PR-URL: https://github.com/nodejs/node/pull/4272


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarBrian White <mscdex@mscdex.net>
Reviewed-By: default avatarSaúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarRod Vagg <rod@vagg.org>
parent ac153bd2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment