diff --git a/src/node_url.cc b/src/node_url.cc index 8e6906790a3752..b7aeb8b006284f 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 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; }