summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/chainingdb
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-07-06 16:47:45 -0600
committerRich Megginson <rmeggins@redhat.com>2010-07-06 17:41:20 -0600
commit85eb9216d5d4163139a90432084452cf81c8444e (patch)
treea1f1306ce6cb9f2d346eaddefcf75a29d29f91f0 /ldap/servers/plugins/chainingdb
parent7a9c069a7d64c1370353278c34bf9065aeb604ea (diff)
downloadds-85eb9216d5d4163139a90432084452cf81c8444e.tar.gz
ds-85eb9216d5d4163139a90432084452cf81c8444e.tar.xz
ds-85eb9216d5d4163139a90432084452cf81c8444e.zip
Bug 611850 - fix coverity Defect Type: Error handling issues
https://bugzilla.redhat.com/show_bug.cgi?id=611850 Resolves: bug 611850 Bug Description: fix coverity Defect Type: Error handling issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Check the error return from the functions. In some cases, I was able to figure out that the calling function should perform additional error handling (return early, goto error label), but in general the code just logs an appropriate error message and continues. I was able to get rid of some more libacl code. I removed an unused variable from modify.c Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
Diffstat (limited to 'ldap/servers/plugins/chainingdb')
-rw-r--r--ldap/servers/plugins/chainingdb/cb_controls.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ldap/servers/plugins/chainingdb/cb_controls.c b/ldap/servers/plugins/chainingdb/cb_controls.c
index ca64595c..142284a9 100644
--- a/ldap/servers/plugins/chainingdb/cb_controls.c
+++ b/ldap/servers/plugins/chainingdb/cb_controls.c
@@ -224,12 +224,15 @@ int cb_update_controls( Slapi_PBlock * pb,
if (!strcmp(reqControls[cCount]->ldctl_oid,CB_LDAP_CONTROL_CHAIN_SERVER)) {
/* Max hop count reached ? */
- /* Checked realier by a call to cb_forward_operation() */
+ /* Checked earlier by a call to cb_forward_operation() */
BerElement *ber = NULL;
ber = ber_init(&(reqControls[cCount]->ldctl_value));
- ber_scanf(ber,"i",&hops);
+ if (LBER_ERROR == ber_scanf(ber,"i",&hops)) {
+ slapi_log_error( SLAPI_LOG_PLUGIN,CB_PLUGIN_SUBSYSTEM,
+ "Unable to get number of hops from the chaining control\n");
+ }
ber_free(ber,1);
useloop=1;