Bug 1215944 - Return false if string is empty. r=mcmanus, a=sylvestre
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 20 Oct 2015 11:47:12 +0200
changeset 296527 4c75c360726765393924489b381110cb8ee6de95
parent 296526 11dfa76155057efdd00c87673af09726ccad3aea
child 296528 7d21efcf73657bf0069348a25c7da537e9950160
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sylvestre
bugs1215944
milestone43.0a2
Bug 1215944 - Return false if string is empty. r=mcmanus, a=sylvestre
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;
     }