From: Howard Chu Date: Thu, 22 May 2003 06:24:23 +0000 (+0000) Subject: Fix reading multibyte lengths X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~84 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=13aa48e47aa50188727b413e35080f65a5ee49ca;p=openldap Fix reading multibyte lengths --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index ecab5860ae..65913a4096 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -551,12 +551,19 @@ ber_get_next( return LBER_DEFAULT; } } - if (sblen == 1) continue; - ber->ber_tag = tag; ber->ber_ptr = (char *)p; } + if ( ber->ber_ptr == ber->ber_rwptr ) { +#if defined( EWOULDBLOCK ) + errno = EWOULDBLOCK; +#elif defined( EAGAIN ) + errno = EAGAIN; +#endif + return LBER_DEFAULT; + } + /* Now look for the length */ if (*ber->ber_ptr & 0x80) { /* multi-byte */ ber_len_t i;