Bug 866380 - Null check for amlogic libc implementation. r=valentin
authorPatrick McManus <mcmanus@ducksong.com>
Wed, 06 Apr 2016 18:38:35 -0400
changeset 316000 8d53524fd01d347e4f7b9cda1a7381339aa23359
parent 315999 43a6c26b28aeda91f8e346fcf5f35966089f1b4c
child 316001 2b0d5a27da0f8c83192a3a7965874ac111dfb458
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs866380
milestone48.0a1
Bug 866380 - Null check for amlogic libc implementation. r=valentin
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -403,17 +403,18 @@ HostDB_HashKey(const void *key)
 
 static bool
 HostDB_MatchEntry(const PLDHashEntryHdr *entry,
                   const void *key)
 {
     const nsHostDBEnt *he = static_cast<const nsHostDBEnt *>(entry);
     const nsHostKey *hk = static_cast<const nsHostKey *>(key); 
 
-    return !strcmp(he->rec->host, hk->host) &&
+    return !strcmp(he->rec->host ? he->rec->host : "",
+                   hk->host ? hk->host : "") &&
             RES_KEY_FLAGS (he->rec->flags) == RES_KEY_FLAGS(hk->flags) &&
             he->rec->af == hk->af &&
             !strcmp(he->rec->netInterface, hk->netInterface);
 }
 
 static void
 HostDB_MoveEntry(PLDHashTable *table,
                  const PLDHashEntryHdr *from,