From 3ee18083403cc8307ddecbb4abba48c62dad8475 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Nov 02 2011 01:00:13 +0000 Subject: Bug 750625 - Fix Coverity (11117) Uninitialized pointer read https://bugzilla.redhat.com/show_bug.cgi?id=750625 slapd/tools/ldclt/ldapfct.c (getPending) Bug Description: Using uninitialized value "verb" when calling "printf". Fix Description: If the mode is not the supported operations, getPending immediately return instead of going forward. --- diff --git a/ldap/servers/slapd/tools/ldclt/ldapfct.c b/ldap/servers/slapd/tools/ldclt/ldapfct.c index 4d58d88..fd291bb 100644 --- a/ldap/servers/slapd/tools/ldclt/ldapfct.c +++ b/ldap/servers/slapd/tools/ldclt/ldapfct.c @@ -2348,24 +2348,25 @@ getPending ( expected = LDAP_RES_ADD; verb = "ldap_add"; } + else if (tttctx->mode & DELETE_ENTRIES) + { + expected = LDAP_RES_DELETE; + verb = "ldap_delete"; + } + else if (tttctx->mode & RENAME_ENTRIES) + { + expected = LDAP_RES_MODRDN; + verb = "ldap_rename"; + } + else if (tttctx->mode & ATTR_REPLACE) /*JLS 21-11-00*/ + { + expected = LDAP_RES_MODIFY; /*JLS 21-11-00*/ + verb = "ldap_modify"; /*JLS 21-11-00*/ + } else - if (tttctx->mode & DELETE_ENTRIES) - { - expected = LDAP_RES_DELETE; - verb = "ldap_delete"; - } - else - if (tttctx->mode & RENAME_ENTRIES) - { - expected = LDAP_RES_MODRDN; - verb = "ldap_rename"; - } - else /*JLS 21-11-00*/ - if (tttctx->mode & ATTR_REPLACE) /*JLS 21-11-00*/ - { /*JLS 21-11-00*/ - expected = LDAP_RES_MODIFY; /*JLS 21-11-00*/ - verb = "ldap_modify"; /*JLS 21-11-00*/ - } /*JLS 21-11-00*/ + { + return (-1); + } /* * Here, we are in asynchronous mode...