Tuesday, June 14, 2016

[389-commits] ldap/servers

ldap/servers/slapd/plugin_mr.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit a0b8f4698ef4aa19bbb4c6ce5df6cc1383fe4fee
Author: Noriko Hosoi <nhosoi@redhat.com>
Date: Tue Jun 14 14:47:09 2016 -0700

Ticket 48745 - Matching Rule caseExactIA5Match indexes incorrectly values with upper cases

Description: Fixing a minor coverity defect introduced by #48745.
> Defect type: REVERSE_INULL
> plugin_mr.c:671: check_after_deref: Null-checking "pi" suggests that
> it may be null, but it has already been dereferenced on all paths
> leading to the check.
Moving the NULL check back to the original position.

diff --git a/ldap/servers/slapd/plugin_mr.c b/ldap/servers/slapd/plugin_mr.c
index 22c3f73..0f9cb4d 100644
--- a/ldap/servers/slapd/plugin_mr.c
+++ b/ldap/servers/slapd/plugin_mr.c
@@ -655,23 +655,23 @@ default_mr_indexer_create(Slapi_PBlock* pb)
{
int rc = -1;
struct slapdplugin *pi = NULL;
- char* oid = NULL;
-
+ char* oid = NULL;
+
slapi_pblock_get(pb, SLAPI_PLUGIN, &pi);
- slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &oid);
- /* this default_mr_indexer_create can be common indexer create to several
- * MR plugin. We need to check the selected plugin handle the expected OID
- */
- if ( oid == NULL || !charray_inlist(pi->plg_mr_names, oid)) {
- LDAPDebug2Args(LDAP_DEBUG_ANY, "default_mr_indexer_create: warning - plugin [%s] does not handle %s\n",
- pi->plg_name,
- oid ? oid : "unknown oid");
- goto done;
- }
if (NULL == pi) {
LDAPDebug0Args(LDAP_DEBUG_ANY, "default_mr_indexer_create: error - no plugin specified\n");
goto done;
}
+ slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &oid);
+ /* this default_mr_indexer_create can be common indexer create to several
+ * MR plugin. We need to check the selected plugin handle the expected OID
+ */
+ if ( oid == NULL || !charray_inlist(pi->plg_mr_names, oid)) {
+ LDAPDebug2Args(LDAP_DEBUG_ANY, "default_mr_indexer_create: warning - plugin [%s] does not handle %s\n",
+ pi->plg_name,
+ oid ? oid : "unknown oid");
+ goto done;
+ }

if (NULL == pi->plg_mr_values2keys) {
LDAPDebug1Arg(LDAP_DEBUG_ANY, "default_mr_indexer_create: error - plugin [%s] has no plg_mr_values2keys function\n",

--
389-commits mailing list
389-commits@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/389-commits@lists.fedoraproject.org

No comments:

Post a Comment