From 00c645b9a1e47992a08ef129018581d4267403c0 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 3 May 2001 05:51:39 +0000 Subject: [PATCH] ITS#133 --- libraries/liblber/io.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) { -- 2.39.5