mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-13 14:27:59 +08:00
don't get tricked when option separator occurs past end of berval
This commit is contained in:
parent
ba0996f1c1
commit
e9cb5b0efb
@ -174,12 +174,15 @@ int slap_bv2ad(
|
||||
}
|
||||
|
||||
/* find valid base attribute type; parse in place */
|
||||
memset( &desc, 0, sizeof( desc ));
|
||||
memset( &desc, 0, sizeof( desc ) );
|
||||
desc.ad_cname = *bv;
|
||||
name = bv->bv_val;
|
||||
options = strchr(name, ';');
|
||||
if( options != NULL ) {
|
||||
options = strchr( name, ';' );
|
||||
if ( options != NULL && ( options - name ) < bv->bv_len ) {
|
||||
/* don't go past the end of the berval! */
|
||||
desc.ad_cname.bv_len = options - name;
|
||||
} else {
|
||||
options = NULL;
|
||||
}
|
||||
desc.ad_type = at_bvfind( &desc.ad_cname );
|
||||
if( desc.ad_type == NULL ) {
|
||||
|
Loading…
Reference in New Issue
Block a user