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 303679 8dc73ca2ec858a58237c5a4ec66244fa822d9cfc
parent 303678 fb1068402c0151176ad4000d8044cd7f8eb617df
child 303680 73b53d0fb12ea8d0186f82cd3de35e907fc29fa9
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [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;
     }