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 8bad519

Browse filesBrowse files
committed
src: return UV_EAI_NODATA on empty lookup
AfterGetAddrInfo() can potentially return an empty array of results without setting an error value. The JavaScript layer expects the array to have at least one value if an error is not returned. This commit sets a UV_EAI_NODATA error when an empty result array is detected. Fixes: #4545 PR-URL: #4715 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
1 parent 761cf2b commit 8bad519
Copy full SHA for 8bad519

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎src/cares_wrap.cc‎

Copy file name to clipboardExpand all lines: src/cares_wrap.cc
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,10 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
983983
address = address->ai_next;
984984
}
985985

986+
// No responses were found to return
987+
if (n == 0) {
988+
argv[0] = Integer::New(env->isolate(), UV_EAI_NODATA);
989+
}
986990

987991
argv[1] = results;
988992
}

0 commit comments

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