From: Howard Chu Date: Mon, 3 Mar 2003 23:44:22 +0000 (+0000) Subject: Fix ITS#2344, prev commit changed too much. X-Git-Tag: NO_SLAP_OP_BLOCKS~192 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=50ecec94eb73c6fa8d6f428ef55fe00282d96c48;p=openldap Fix ITS#2344, prev commit changed too much. --- diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index dbe7a73dde..931982cf90 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -512,7 +512,7 @@ ber_get_next( while (ber->ber_rwptr > (char *)&ber->ber_tag && ber->ber_rwptr < (char *)&ber->ber_len + LENSIZE*2) { ber_slen_t sblen; - char buf[LENSIZE-1]; + char buf[sizeof(ber->ber_len)-1]; ber_len_t tlen = 0; sblen=ber_int_sb_read( sb, ber->ber_rwptr, @@ -574,11 +574,11 @@ ber_get_next( } /* Are there leftover data bytes inside ber->ber_len? */ - if (ber->ber_ptr < (char *)&ber->ber_len+LENSIZE) { - if (ber->ber_rwptr < (char *)&ber->ber_len+LENSIZE) + if (ber->ber_ptr < (char *)&ber->ber_usertag) { + if (ber->ber_rwptr < (char *)&ber->ber_usertag) sblen = ber->ber_rwptr - ber->ber_ptr; else - sblen = ((char *)&ber->ber_len+LENSIZE) - ber->ber_ptr; + sblen = (char *)&ber->ber_usertag - ber->ber_ptr; AC_MEMCPY(buf, ber->ber_ptr, sblen); ber->ber_ptr += sblen; } else {