Bug 866380 - Null check for amlogic libc implementation. r=valentin, a=ritu
authorPatrick McManus <mcmanus@ducksong.com>
Wed, 06 Apr 2016 18:38:35 -0400
changeset 325773 9b649cb10e0a589f7d23f547ff92977ad2ec4f6a
parent 325772 5f050838a6a2f33a3802ed696793232d5054e226
child 325774 035a7708f988d1ac582a9d4d1a37456e9a1875d0
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, ritu
bugs866380
milestone47.0a2
Bug 866380 - Null check for amlogic libc implementation. r=valentin, a=ritu
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -404,17 +404,18 @@ HostDB_HashKey(PLDHashTable *table, cons
 static bool
 HostDB_MatchEntry(PLDHashTable *table,
                   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,