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: add missing to_ascii method in dns queries #48347

Closed
wants to merge 1 commit into from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Jun 5, 2023

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run. labels Jun 5, 2023
@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 5, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 5, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 5, 2023
auto wrap = std::make_unique<Wrap>(channel, req_wrap_obj);

node::Utf8Value name(env->isolate(), string);
auto plain_name =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this code is safe because it appears that temporary objects are created, and they go out of scope. The result of node::Utf8Value is converted to a string_view, but a string_view pointing at what instance? It is unclear to me.

I recommend breaking this down...

Local<String> string = args[1].As<String>();
node::Utf8Value utf8name(env->isolate(), string);
std::string name = ada::idna::to_ascii(utf8name.ToStringView());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lemire Would you like to takeover this pull request? Unfortunately, I can't complete it soon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anonrig
Copy link
Member Author

anonrig commented Jun 5, 2023

Closing in favor of @lemire 's pull request

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++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test/internet/test-dns-idna2008.js fails
4 participants