mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 18:19:52 -05:00
cleanup getattr bailout code
This commit is contained in:
parent
fcc86b2456
commit
1890b720b4
2 changed files with 16 additions and 12 deletions
|
|
@ -60,13 +60,7 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **berout )
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#if LDAP_SEQORSET_BAILOUT
|
||||
if( len == 0 ) {
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LBER_SEQORSET_AVOID_OVERRUN
|
||||
#ifdef LBER_SEQORSET_AVOID_OVERRUN
|
||||
/* set the length to avoid overrun */
|
||||
rc = ber_set_option( ber, LBER_OPT_REMAINING_BYTES, &len );
|
||||
if( rc != LBER_OPT_SUCCESS ) {
|
||||
|
|
@ -74,6 +68,14 @@ ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **berout )
|
|||
ber_free( ber, 0 );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef LDAP_SEQORSET_BAILOUT
|
||||
if ( ber_pvt_ber_remaining( ber ) == 0 ) {
|
||||
assert( len == 0 );
|
||||
return NULL;
|
||||
}
|
||||
assert( len != 0 );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* snatch the first attribute */
|
||||
|
|
@ -102,10 +104,12 @@ ldap_next_attribute( LDAP *ld, LDAPMessage *entry, BerElement *ber )
|
|||
assert( entry != NULL );
|
||||
assert( ber != NULL );
|
||||
|
||||
#if LDAP_SEQORSET_BAILOUT
|
||||
#ifdef LBER_SEQORSET_AVOID_OVERRUN
|
||||
#ifdef LDAP_SEQORSET_BAILOUT
|
||||
if ( ber_pvt_ber_remaining( ber ) == 0 ) {
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* skip sequence, snarf attribute type, skip values */
|
||||
|
|
|
|||
|
|
@ -953,9 +953,9 @@ ldap_append_referral( LDAP *ld, char **referralsp, char *s )
|
|||
static BerElement *
|
||||
re_encode_request( LDAP *ld, BerElement *origber, ber_int_t msgid, char **dnp, int *type )
|
||||
{
|
||||
/*
|
||||
* XXX this routine knows way too much about how the lber library works!
|
||||
*/
|
||||
/*
|
||||
* XXX this routine knows way too much about how the lber library works!
|
||||
*/
|
||||
ber_int_t along;
|
||||
ber_tag_t tag;
|
||||
ber_int_t ver;
|
||||
|
|
@ -1050,7 +1050,7 @@ re_encode_request( LDAP *ld, BerElement *origber, ber_int_t msgid, char **dnp, i
|
|||
LDAPRequest *
|
||||
ldap_find_request_by_msgid( LDAP *ld, ber_int_t msgid )
|
||||
{
|
||||
LDAPRequest *lr;
|
||||
LDAPRequest *lr;
|
||||
|
||||
for ( lr = ld->ld_requests; lr != NULL; lr = lr->lr_next ) {
|
||||
if( lr->lr_status == LDAP_REQST_COMPLETED ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue