diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 07:29:18 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 07:29:18 +0200 |
commit | ae14556114dcae29f679db7c15f0bc9b707bb89a (patch) | |
tree | b7f02d4463293a5fb0f3823bd48230a142c5a42d /toolkit/components/places/nsNavHistory.cpp | |
parent | 8a95c03dcd2a7f2c6d64b6ee917f6cb363e9ca60 (diff) | |
download | uxp-ae14556114dcae29f679db7c15f0bc9b707bb89a.tar.gz |
moebius#130: URL parser - fix: don't allow empty host name
https://github.com/MoonchildProductions/moebius/issues/130
Diffstat (limited to 'toolkit/components/places/nsNavHistory.cpp')
-rw-r--r-- | toolkit/components/places/nsNavHistory.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index 8cf3a2e324..7f4007c1ab 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -949,6 +949,10 @@ nsresult // static nsNavHistory::AsciiHostNameFromHostString(const nsACString& aHostName, nsACString& aAscii) { + aAscii.Truncate(); + if (aHostName.IsEmpty()) { + return NS_OK; + } // To properly generate a uri we must provide a protocol. nsAutoCString fakeURL("http://"); fakeURL.Append(aHostName); |