if ( sb->sb_debug ) {
ber_log_printf( LDAP_DEBUG_ANY, sb->sb_debug,
- "ber_flush: %ld bytes to sd %ld%s\n", towrite,
- (long) sb->sb_fd, ber->ber_rwptr != ber->ber_buf ?
- " (re-flush)" : "" );
+ "ber_flush: %ld bytes to sd %ld%s\n",
+ towrite, (long) sb->sb_fd,
+ ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" );
ber_log_bprint( LDAP_DEBUG_PACKETS, sb->sb_debug,
ber->ber_rwptr, towrite );
}
}
do {
/* reading the tag... */
- if (ber_int_sb_read( sb, ber->ber_rwptr, 1)<=0)
+ if (ber_int_sb_read( sb, ber->ber_rwptr, 1)<=0) {
return LBER_DEFAULT;
+ }
+
if (! (ber->ber_rwptr[0] & LBER_MORE_TAG_MASK) ) {
ber->ber_tag>>=sizeof(ber->ber_tag) -
((char *) &ber->ber_tag - ber->ber_rwptr);
goto get_lenbyte;
}
} while( PTR_IN_VAR(ber->ber_rwptr, ber->ber_tag ));
+
errno = ERANGE; /* this is a serious error. */
return LBER_DEFAULT;
}
e->e_attrs = NULL;
e->e_private = NULL;
- Debug( LDAP_DEBUG_ARGS, " do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
+ Debug( LDAP_DEBUG_ARGS, "do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
/* get the attrs */
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
}
errno = 0;
- if ( (tag = ber_get_next( conn->c_sb, &len, conn->c_currentber ))
- != LDAP_TAG_MESSAGE )
- {
+
+ tag = ber_get_next( conn->c_sb, &len, conn->c_currentber );
+ if ( tag != LDAP_TAG_MESSAGE ) {
int err = errno;
ber_socket_t sd;
*d++ = *s;
}
break;
+
case B4SEPARATOR:
if ( RDN_SEPARATOR( *s ) ) {
state = B4TYPE;
*d++ = *s;
}
break;
+
default:
dn = NULL;
Debug( LDAP_DEBUG_ANY,
"dn_validate - unknown state %d\n", state, 0, 0 );
break;
}
+
if ( *s == '\\' ) {
gotesc = 1;
} else {