Skip to content
Snippets Groups Projects
Commit 62f4745b authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

ITS#4679 cleanup

Note: the caller is expected to pass in a valid LDAP handle.  If not,
the assert will trigger to let him know his code is broken.
parent a8e58e3e
No related branches found
No related tags found
No related merge requests found
......@@ -296,14 +296,15 @@ ldap_create_sort_control_value(
BerElement *ber = NULL;
ber_tag_t tag;
if ( ld == NULL || keyList == NULL || value == NULL ) {
if ( ld )
ld->ld_errno = LDAP_PARAM_ERROR;
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
if ( ld == NULL ) return LDAP_PARAM_ERROR;
if ( keyList == NULL || value == NULL ) {
ld->ld_errno = LDAP_PARAM_ERROR;
return LDAP_PARAM_ERROR;
}
assert( LDAP_VALID( ld ) );
value->bv_val = NULL;
value->bv_len = 0;
......@@ -412,6 +413,10 @@ ldap_create_sort_control(
struct berval value;
BerElement *ber;
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
if ( ld == NULL ) return LDAP_PARAM_ERROR;
if ( ctrlp == NULL ) {
ld->ld_errno = LDAP_PARAM_ERROR;
return ld->ld_errno;
......@@ -496,6 +501,9 @@ ldap_parse_sortresponse_control(
ber_tag_t tag, berTag;
ber_len_t berLen;
assert( ld != NULL );
assert( LDAP_VALID( ld ) );
if (ld == NULL) {
return LDAP_PARAM_ERROR;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment