You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/05/08 12:42:57 UTC

[trafficserver] branch master updated: Fix Dereference of null pointer in HashMap

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 614d8a9  Fix Dereference of null pointer in HashMap
614d8a9 is described below

commit 614d8a95bf1193402b895a151b4b27a35319e8a2
Author: Steven Feltner <sf...@godaddy.com>
AuthorDate: Mon May 7 10:46:40 2018 -0400

    Fix Dereference of null pointer in HashMap
---
 lib/ts/Map.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/ts/Map.h b/lib/ts/Map.h
index a46a262..e68cf2b 100644
--- a/lib/ts/Map.h
+++ b/lib/ts/Map.h
@@ -1636,9 +1636,11 @@ HashMap<K, AHashFns, C, A>::put(K akey, C avalue)
   }
   HashMap<K, AHashFns, C, A> vv(*this);
   Map<K, C, A>::set_expand();
-  for (size_t i = 0; i < vv.n; i++)
-    if (vv.v[i].key)
+  for (size_t i = 0; i < vv.n; i++) {
+    if (vv.v && vv.v[i] && vv.v[i].key) {
       put(vv.v[i].key, vv.v[i].value);
+    }
+  }
   return put(akey, avalue);
 }
 

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.