Bug 1215944 - Return false if string is empty. r=mcmanus
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 20 Oct 2015 11:47:12 +0200
changeset 268479 8dc73ca2ec858a58237c5a4ec66244fa822d9cfc
parent 268478 fb1068402c0151176ad4000d8044cd7f8eb617df
child 268480 73b53d0fb12ea8d0186f82cd3de35e907fc29fa9
push id66848
push usercbook@mozilla.com
push dateTue, 20 Oct 2015 09:47:24 +0000
treeherdermozilla-inbound@8dc73ca2ec85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1215944
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1215944 - Return false if string is empty. r=mcmanus
netwerk/base/nsStandardURL.cpp
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -419,17 +419,18 @@ nsStandardURL::NormalizeIDN(const nsCSub
 
     result.Truncate();
     return false;
 }
 
 bool
 nsStandardURL::ValidIPv6orHostname(const char *host, uint32_t length)
 {
-    if (!host) {
+    if (!host || !*host) {
+        // Should not be NULL or empty string
         return false;
     }
 
     if (length != strlen(host)) {
         // Embedded null
         return false;
     }