diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2020-09-07 16:50:19 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2020-09-16 09:23:41 +0300 |
commit | 69ef4c2375b5110886b08957cd2305ce8aa8eb32 (patch) | |
tree | ee9c8e9a69ad19e7fbe76d0bc9c2457667baa5d6 /src/node_url.cc | |
parent | 4831278a16d0cbe9e54ba89f1bf4f114aed06e69 (diff) |
url: verify domain is not empty after "ToASCII"
Port of https://github.com/whatwg/url/pull/497
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src/node_url.cc')
-rw-r--r-- | src/node_url.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_url.cc b/src/node_url.cc index 8e6906790a3..b7aeb8b0062 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -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; } |