diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2007-09-28 23:46:40 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2007-09-28 23:46:40 +0000 |
commit | 1362fc2e63488b9ffe5313024ffa129da6a6125b (patch) | |
tree | 076820f0424f76a980f6d1c9e462f800bc4e80a0 /ldap/servers/slapd/back-ldbm | |
parent | e80ce4e03d91c386fc11135bf459e67f85afd7de (diff) | |
download | ds-1362fc2e63488b9ffe5313024ffa129da6a6125b.tar.gz ds-1362fc2e63488b9ffe5313024ffa129da6a6125b.tar.xz ds-1362fc2e63488b9ffe5313024ffa129da6a6125b.zip |
Resolves #222918
Summary: server crash after deleting supposedly deleted attribute
Description:
index.c: if there is no attribute to delete, don't call index_addordel_values_svstring.c: changed string_values2keys to handle NULL bvals
Diffstat (limited to 'ldap/servers/slapd/back-ldbm')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/index.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c index dab71e28..9da2389c 100644 --- a/ldap/servers/slapd/back-ldbm/index.c +++ b/ldap/servers/slapd/back-ldbm/index.c @@ -628,9 +628,12 @@ index_add_mods( flags = BE_INDEX_DEL|BE_INDEX_PRESENCE|BE_INDEX_EQUALITY; } - /* Update the index */ - index_addordel_values_sv( be, mods[i]->mod_type, - deleted_valueArray, evals, id, flags, txn); + /* Update the index, if necessary */ + if (deleted_valueArray) { + index_addordel_values_sv( be, mods[i]->mod_type, + deleted_valueArray, evals, id, + flags, txn ); + } slapi_valueset_free(mod_vals); } else { @@ -645,18 +648,18 @@ index_add_mods( flags = BE_INDEX_DEL; } - /* If the same value doesn't exist in a subtype, set - * BE_INDEX_EQUALITY flag so the equality index is - * removed. - */ - slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr); + /* If the same value doesn't exist in a subtype, set + * BE_INDEX_EQUALITY flag so the equality index is + * removed. + */ + slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr); for (j = 0; mods_valueArray[j] != NULL; j++ ) { - if ( valuearray_find(curr_attr, evals, mods_valueArray[j]) == -1 ) { + if ( valuearray_find(curr_attr, evals, mods_valueArray[j]) == -1 ) { if (!(flags & BE_INDEX_EQUALITY)) { - flags |= BE_INDEX_EQUALITY; + flags |= BE_INDEX_EQUALITY; } } - } + } rc = index_addordel_values_sv( be, basetype, mods_valueArray, |