ITS#5580 fix length decoding, verified with PROTOS

This commit is contained in:
Howard Chu 2008-06-27 02:36:41 +00:00
parent 9ef6cc3cd4
commit 14f1138ab5

View File

@ -584,13 +584,11 @@ ber_get_next(
return LBER_DEFAULT;
}
/* Not enough bytes? */
if (ber->ber_rwptr - (char *)p < llen) {
#if defined( EWOULDBLOCK )
sock_errset(EWOULDBLOCK);
#elif defined( EAGAIN )
sock_errset(EAGAIN);
#endif
return LBER_DEFAULT;
i = ber->ber_rwptr - (char *)p;
if (i < llen) {
sblen=ber_int_sb_read( sb, ber->ber_rwptr, i );
if (sblen<i) return LBER_DEFAULT;
ber->ber_rwptr += sblen;
}
for (i=0; i<llen; i++) {
tlen <<=8;