Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: return UV_EAI_NODATA on empty lookup #4715

Closed
wants to merge 1 commit into from
Closed

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Jan 15, 2016

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

R= @evanlucas

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: nodejs#4545
@evanlucas
Copy link
Contributor

LGTM if it works

@mscdex mscdex added c++ Issues and PRs that require attention from people who are familiar with C++. dns Issues and PRs related to the dns subsystem. labels Jan 15, 2016
@silverwind
Copy link
Contributor

@allthetime can you possibly verify?

@bnoordhuis
Copy link
Member

LGTM

@cjihrig
Copy link
Contributor Author

cjihrig commented Jan 18, 2016

@saghul
Copy link
Member

saghul commented Jan 18, 2016

LGTM

cjihrig added a commit that referenced this pull request Jan 18, 2016
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>
@cjihrig
Copy link
Contributor Author

cjihrig commented Jan 18, 2016

CI is all green. Thanks for the reviews! Landed in 8bad519.

@cjihrig cjihrig closed this Jan 18, 2016
@cjihrig cjihrig deleted the dns branch January 18, 2016 15:01
@jasnell
Copy link
Member

jasnell commented Jan 18, 2016

This is fine, but would it be possible to also get a test case added to go along with this?

@cjihrig
Copy link
Contributor Author

cjihrig commented Jan 18, 2016

I'd be happy to, but haven't been able to reproduce. I had to force n to zero during testing to make sure it was working.

@jasnell
Copy link
Member

jasnell commented Jan 18, 2016

yep, understood.

evanlucas pushed a commit that referenced this pull request Jan 18, 2016
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>
@MylesBorins
Copy link
Contributor

Is this something we might want for lts?

@jasnell
Copy link
Member

jasnell commented Mar 11, 2016

SGTM

@rvagg
Copy link
Member

rvagg commented Mar 14, 2016

+1 for lts

MylesBorins pushed a commit that referenced this pull request Mar 17, 2016
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>
MylesBorins pushed a commit that referenced this pull request Mar 21, 2016
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>
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
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: nodejs#4545
PR-URL: nodejs#4715
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. dns Issues and PRs related to the dns subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants