Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ce6843

Browse filesBrowse files
martinbarkMyles Borins
authored andcommitted
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: Martin Bark <martin@barkynet.com> PR-URL: #4272 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
1 parent f613b30 commit 8ce6843
Copy full SHA for 8ce6843

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎src/node_os.cc‎

Copy file name to clipboardExpand all lines: src/node_os.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
200200
ret = Object::New(env->isolate());
201201

202202
if (err == UV_ENOSYS) {
203-
args.GetReturnValue().Set(ret);
203+
return args.GetReturnValue().Set(ret);
204204
} else if (err) {
205205
return env->ThrowUVException(err, "uv_interface_addresses");
206206
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.