Skip to content

Commit

Permalink
url: verify domain is not empty after "ToASCII"
Browse files Browse the repository at this point in the history
Port of whatwg/url#497

PR-URL: #33770
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
targos authored and nodejs-github-bot committed Sep 16, 2020
1 parent 4831278 commit 69ef4c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ bool ToASCII(const std::string& input, std::string* output) {
MaybeStackBuffer<char> buf;
if (i18n::ToASCII(&buf, input.c_str(), input.length()) < 0)
return false;
if (buf.length() == 0)
return false;
output->assign(*buf, buf.length());
return true;
}
Expand Down

0 comments on commit 69ef4c2

Please sign in to comment.