summaryrefslogtreecommitdiffstats
path: root/ldap/servers
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-07-09 20:53:25 -0500
committerNoriko Hosoi <nhosoi@redhat.com>2010-08-20 11:54:14 -0700
commita82d3eede0912a86842dc3f2ba18b0484f70485f (patch)
tree477322c12b0e16e71ab1a4f5bbd06cba9bbb9513 /ldap/servers
parent1c2aaea82b9a6aa1f43886d1f9bdb86acf9109ca (diff)
downloadds-a82d3eede0912a86842dc3f2ba18b0484f70485f.tar.gz
ds-a82d3eede0912a86842dc3f2ba18b0484f70485f.tar.xz
ds-a82d3eede0912a86842dc3f2ba18b0484f70485f.zip
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
https://bugzilla.redhat.com/show_bug.cgi?id=613056 Resolves: bug 613056 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939 description: The destroy_task() has been modified to return when the task is NULL. The task_upgradedb_add() has been modified to return an error when be is NULL.
Diffstat (limited to 'ldap/servers')
-rw-r--r--ldap/servers/slapd/task.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/ldap/servers/slapd/task.c b/ldap/servers/slapd/task.c
index a7fe7892..9b2e5ed3 100644
--- a/ldap/servers/slapd/task.c
+++ b/ldap/servers/slapd/task.c
@@ -538,7 +538,11 @@ destroy_task(time_t when, void *arg)
{
Slapi_Task *task = (Slapi_Task *)arg;
Slapi_Task *t1;
- Slapi_PBlock *pb = slapi_pblock_new();
+ Slapi_PBlock *pb;
+
+ if (task == NULL) return;
+
+ pb = slapi_pblock_new();
/* Call the custom destructor callback if one was provided,
* then perform the internal task destruction. */
@@ -1737,7 +1741,14 @@ task_upgradedb_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter,
be = (backend *)slapi_get_next_backend (cookie);
}
slapi_ch_free((void **)&cookie);
- if (NULL == be || NULL == be->be_database->plg_upgradedb ||
+ if (NULL == be) {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "ERROR: no upgradedb is defined.\n", 0, 0, 0);
+ *returncode = LDAP_UNWILLING_TO_PERFORM;
+ rv = SLAPI_DSE_CALLBACK_ERROR;
+ goto out;
+ }
+ if (NULL == be->be_database->plg_upgradedb ||
strcasecmp(database_type, be->be_database->plg_name)) {
LDAPDebug(LDAP_DEBUG_ANY,
"ERROR: no upgradedb is defined in %s.\n",