zrhoffman / rpms / 389-ds-base

Forked from rpms/389-ds-base 3 years ago
Clone

Blame SOURCES/0093-Ticket-408-create-a-normalized-dn-cache.patch

cc3dff
From 6cf6bea5372a57ffeee304c601e665f13861353c Mon Sep 17 00:00:00 2001
cc3dff
From: Noriko Hosoi <nhosoi@redhat.com>
cc3dff
Date: Tue, 25 Feb 2014 16:54:22 -0800
cc3dff
Subject: [PATCH] Ticket 408 - create a normalized dn cache
cc3dff
cc3dff
covscan Defect type: FORWARD_NULL
cc3dff
15. 389-ds-base-1.3.1.6/ldap/servers/slapd/dn.c:3036:var_deref_op -
cc3dff
    Dereferencing null pointer "node".
cc3dff
Introduced by commit 1d6dd39fb8b0ef8eb42ec9ef8c3d325e27a3d3c1
cc3dff
Fix: Check if "node" is null or not before referencing.
cc3dff
Note: Found second FORWARD_NULL in addition to
cc3dff
      commit 5ac08038a05877b4240755801debd5e5a3a94c6f,
cc3dff
(cherry picked from commit ea13cda8f49646be8a9a5e468b2819bd2d91ca87)
cc3dff
(cherry picked from commit dfa36fd4a7ab243a5692e7792d19e67e63b1e397)
cc3dff
(cherry picked from commit 347ffb722f7d376e0ad2c565ada533f0dad3cfb8)
cc3dff
---
cc3dff
 ldap/servers/slapd/dn.c | 2 +-
cc3dff
 1 file changed, 1 insertion(+), 1 deletion(-)
cc3dff
cc3dff
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
cc3dff
index 4a11a18..003e9b7 100644
cc3dff
--- a/ldap/servers/slapd/dn.c
cc3dff
+++ b/ldap/servers/slapd/dn.c
cc3dff
@@ -3030,7 +3030,7 @@ ndn_cache_free()
cc3dff
     }
cc3dff
 
cc3dff
     node = ndn_cache->tail;
cc3dff
-    while(ndn_cache->cache_count){
cc3dff
+    while(node && ndn_cache->cache_count){
cc3dff
         flush_node = node;
cc3dff
         /* update the lru */
cc3dff
         next = node->prev;
cc3dff
-- 
cc3dff
1.8.1.4
cc3dff