From: Kurt Zeilenga Date: Sat, 16 Sep 2000 01:28:20 +0000 (+0000) Subject: Validate ber on get/set option calls X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1967 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=55ad2c93196018a5a05ffead082ea355f3779a19;p=openldap Validate ber on get/set option calls --- diff --git a/libraries/liblber/options.c b/libraries/liblber/options.c index 13a484335e..6029c8aa2f 100644 --- a/libraries/liblber/options.c +++ b/libraries/liblber/options.c @@ -71,14 +71,17 @@ ber_get_option( return LBER_OPT_SUCCESS; case LBER_OPT_BER_REMAINING_BYTES: + assert( BER_VALID( ber ) ); *((ber_len_t *) outvalue) = ber_pvt_ber_remaining(ber); return LBER_OPT_SUCCESS; case LBER_OPT_BER_TOTAL_BYTES: + assert( BER_VALID( ber ) ); *((ber_len_t *) outvalue) = ber_pvt_ber_total(ber); return LBER_OPT_SUCCESS; case LBER_OPT_BER_BYTES_TO_WRITE: + assert( BER_VALID( ber ) ); *((ber_len_t *) outvalue) = ber_pvt_ber_write(ber); return LBER_OPT_SUCCESS; @@ -184,14 +187,17 @@ ber_set_option( return LBER_OPT_SUCCESS; case LBER_OPT_BER_REMAINING_BYTES: + assert( BER_VALID( ber ) ); ber->ber_end = &ber->ber_ptr[* (const ber_len_t *) invalue]; return LBER_OPT_SUCCESS; case LBER_OPT_BER_TOTAL_BYTES: + assert( BER_VALID( ber ) ); ber->ber_end = &ber->ber_buf[* (const ber_len_t *) invalue]; return LBER_OPT_SUCCESS; case LBER_OPT_BER_BYTES_TO_WRITE: + assert( BER_VALID( ber ) ); ber->ber_ptr = &ber->ber_buf[* (const ber_len_t *) invalue]; return LBER_OPT_SUCCESS;