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 289599 50213377c223
parent 289598 504f0544d601
child 289600 c480e12985af
push id5210
push usercbook@mozilla.com
push date2015-10-21 14:38 +0000
treeherdermozilla-beta@1fd5bf9d2f18 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, sylvestre
bugs1215944
milestone42.0
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;
     }