summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2010-09-14 13:53:33 -0700
committerNathan Kinder <nkinder@redhat.com>2010-09-15 09:11:06 -0700
commitb95332620490521a66b248e7e3840507f86705a9 (patch)
tree986da472d014b6967206fcea066b8ab87b7bfb84
parent09653dc9d5719d171d71c2b92c9fe8bff94ed4b6 (diff)
downloadds-b95332620490521a66b248e7e3840507f86705a9.tar.gz
ds-b95332620490521a66b248e7e3840507f86705a9.tar.xz
ds-b95332620490521a66b248e7e3840507f86705a9.zip
Bug 630097 - (cov#15465) Null dereference in USN code
At the end of the for loop, be will be NULL if we never find a valid be->be_usn_counter. This will cause us to dereference a NULL pointer at the next if statement after the for loop. We need to check if be is NULL before dereferencing it.
-rw-r--r--ldap/servers/plugins/usn/usn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c
index 914c7acc..4ad9e665 100644
--- a/ldap/servers/plugins/usn/usn.c
+++ b/ldap/servers/plugins/usn/usn.c
@@ -582,7 +582,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter,
break;
}
}
- if (be->be_usn_counter) {
+ if (be && be->be_usn_counter) {
/* get a next USN counter from be_usn_counter;
* then minus 1 from it */
PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRI64 "d",