From: Kurt Zeilenga Date: Thu, 3 May 2001 05:51:39 +0000 (+0000) Subject: ITS#133 X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1449 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=00c645b9a1e47992a08ef129018581d4267403c0;p=openldap ITS#133 --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index b4cc7e5267..71a2feb1e6 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -536,15 +536,20 @@ get_lenbyte: ber->ber_rwptr += res; /* convert length. */ - ber->ber_len = 0; for( to_go = 0; to_go < res ; to_go++ ) { ber->ber_len <<= 8; ber->ber_len |= netlen[to_go]; } + if (PTR_IN_VAR(ber->ber_rwptr, ber->ber_len)) + return LBER_DEFAULT; } fill_buffer: /* now fill the buffer. */ + if (ber->ber_len==0) { + errno = ERANGE; + return LBER_DEFAULT; + } if (ber->ber_buf==NULL) { ber->ber_buf = (char *) LBER_MALLOC( ber->ber_len ); if (ber->ber_buf==NULL) {