From: Howard Chu Date: Tue, 9 Oct 2007 01:38:50 +0000 (+0000) Subject: ITS#5100 ldap_control_dup - OID must be non-NULL X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~529 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cbb6f3bd5056bb922d25903380e7f653efff3169;p=openldap ITS#5100 ldap_control_dup - OID must be non-NULL --- diff --git a/libraries/libldap/controls.c b/libraries/libldap/controls.c index 059dc5266f..48c29a5473 100644 --- a/libraries/libldap/controls.c +++ b/libraries/libldap/controls.c @@ -337,7 +337,7 @@ ldap_control_dup( const LDAPControl *c ) { LDAPControl *new; - if ( c == NULL ) { + if ( c == NULL || c->ldctl_oid == NULL ) { return NULL; } @@ -347,17 +347,11 @@ ldap_control_dup( const LDAPControl *c ) return NULL; } - if( c->ldctl_oid != NULL ) { - new->ldctl_oid = LDAP_STRDUP( c->ldctl_oid ); + new->ldctl_oid = LDAP_STRDUP( c->ldctl_oid ); - if(new->ldctl_oid == NULL) { - LDAP_FREE( new ); - return NULL; - } - - } else { - /* FIXME: how can a control have null OID? */ - new->ldctl_oid = NULL; + if(new->ldctl_oid == NULL) { + LDAP_FREE( new ); + return NULL; } if( c->ldctl_value.bv_val != NULL ) {