Skip to content

Commit 69ef4c2

Browse files
targosnodejs-github-bot
authored andcommitted
url: verify domain is not empty after "ToASCII"
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>
1 parent 4831278 commit 69ef4c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/node_url.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,8 @@ bool ToASCII(const std::string& input, std::string* output) {
779779
MaybeStackBuffer<char> buf;
780780
if (i18n::ToASCII(&buf, input.c_str(), input.length()) < 0)
781781
return false;
782+
if (buf.length() == 0)
783+
return false;
782784
output->assign(*buf, buf.length());
783785
return true;
784786
}

0 commit comments

Comments
 (0)