From cda4bf23fbe1a88008894024effb12f4860de70f Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Mon, 17 Jun 2013 14:33:16 -0700
Subject: [PATCH 69/99] Ticket #47391 - deleting and adding userpassword fails
to update the password
Bug description: Deleting and adding password operation causes
the crash since once an entry is written to and retrieved from
DB, it does not have unhashed#user#password in the entry any
more. The delete userpassword internally invokes delete unhashed
existed in the entry.
Fix description: This patch adds the stricter check for the NULL
reference.
https://fedorahosted.org/389/ticket/47391
Reviewed by Nathan (Thanks!!)
(cherry picked from commit 9d9e9a6f132eb7bcbac3d3d6d39b27e38b6abb6b)
---
ldap/servers/slapd/back-ldbm/index.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index 5948717..62a58a7 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -694,7 +694,7 @@ index_add_mods(
/* Check if the any values being deleted
* also exist in a subtype.
*/
- for ( j=0; deleted_valueArray[j] != NULL; j++) {
+ for (j = 0; deleted_valueArray && deleted_valueArray[j]; j++) {
if ( valuearray_find(curr_attr, evals, deleted_valueArray[j]) == -1 ) {
/* If the equality flag isn't already set, set it */
if (!(flags & BE_INDEX_EQUALITY)) {
--
1.8.1.4