The following commit introduced a defect "13089: Dereference after null
check".
commit b37e0c2e878ecef8c46449ce4e44a3c0deb344f2
Author: Noriko Hosoi <nhosoi@xxxxxxxxxx>
Date: Tue Aug 28 17:28:59 2012 -0700
Trac Ticket #437 - variable dn should not be used in ldbm_back_delete
>From 4c07cdc81c3a5907dbdd536b692572a93d57732a Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@xxxxxxxxxx>
Date: Thu, 30 Aug 2012 15:38:57 -0700
Subject: [PATCH 2/2] Coverity defects
13089: Dereference after null check
ldbm_back_delete (back-ldbm/ldbm_delete.c)
Goto error_return if either of addr or sdnp is NULL.
---
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index fa8221c..580fe4c 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -124,9 +124,11 @@ ldbm_back_delete( Slapi_PBlock *pb )
slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "enter conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
}
- if ((NULL == addr) && (NULL == sdnp))
+ if ((NULL == addr) || (NULL == sdnp))
{
/* retval is -1 */
+ slapi_log_error(SLAPI_LOG_FATAL, "ldbm_back_delete",
+ "Either of DELETE_TARGET_SDN or TARGET_ADDRESS is NULL.\n");
goto error_return;
}
dn = slapi_sdn_get_dn(sdnp);
--
1.7.11.4
--
389-devel mailing list
389-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/389-devel