diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-07-09 20:46:16 -0500 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-20 11:52:23 -0700 |
commit | 404265aa364dfa5936f943e370caf23cb987e061 (patch) | |
tree | 0e95f479774eff7ab22baa3146165eec2210f9ba /ldap/servers | |
parent | f877d18c61c367f6cb5745440d9493a572f8af18 (diff) | |
download | ds-404265aa364dfa5936f943e370caf23cb987e061.tar.gz ds-404265aa364dfa5936f943e370caf23cb987e061.tar.xz ds-404265aa364dfa5936f943e370caf23cb987e061.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: Catch possible NULL pointer in get_ldapmessage_controls_ext().
Diffstat (limited to 'ldap/servers')
-rw-r--r-- | ldap/servers/slapd/control.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ldap/servers/slapd/control.c b/ldap/servers/slapd/control.c index f187f8d0..16d5b6c0 100644 --- a/ldap/servers/slapd/control.c +++ b/ldap/servers/slapd/control.c @@ -222,6 +222,11 @@ get_ldapmessage_controls_ext( LDAPDebug( LDAP_DEBUG_TRACE, "=> get_ldapmessage_controls\n", 0, 0, 0 ); + if (!pb) { + LDAPDebug( LDAP_DEBUG_ANY, "<= get_ldapmessage_controls NULL PBlock\n", 0, 0, 0 ); + return( LDAP_OPERATIONS_ERROR ); /* unexpected error */ + } + ctrls = NULL; slapi_pblock_set( pb, SLAPI_REQCONTROLS, ctrls ); if ( controlsp != NULL ) { @@ -265,7 +270,7 @@ get_ldapmessage_controls_ext( * A sequence of controls is present. If connection is not LDAPv3 * or better, return a protocol error. Otherwise, parse the controls. */ - if ( pb != NULL && pb->pb_conn != NULL + if ( pb->pb_conn != NULL && pb->pb_conn->c_ldapversion < LDAP_VERSION3 ) { slapi_log_error( SLAPI_LOG_FATAL, "connection", "received control(s) on an LDAPv%d connection\n", |