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 ) {
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 */
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 */
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;
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 ) {