From 13aa48e47aa50188727b413e35080f65a5ee49ca Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 22 May 2003 06:24:23 +0000 Subject: [PATCH] Fix reading multibyte lengths --- libraries/liblber/io.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; -- 2.39.5