mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 22:42:04 -04:00
fix erroneous isc_bitstring_copy() REQUIRE
This commit is contained in:
parent
42e31e6ef7
commit
83d2840b6f
2 changed files with 13 additions and 9 deletions
4
CHANGES
4
CHANGES
|
|
@ -1,3 +1,7 @@
|
|||
445. [bug] Doing a 0 bit isc_bitstring_copy() of an lsb0
|
||||
bitstring triggered a REQUIRE statement. The REQUIRE
|
||||
statement was incorrect. [RT #297]
|
||||
|
||||
444. [func] "recursion denied" messages are always logged at
|
||||
debug level 1, now, rather than sometimes at ERROR.
|
||||
This silences these warnings in the usual case, where
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: bitstring.c,v 1.7 2000/08/01 01:29:15 tale Exp $ */
|
||||
/* $Id: bitstring.c,v 1.8 2000/09/12 19:26:40 halley Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -90,20 +90,20 @@ isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
|
|||
REQUIRE(VALID_BITSTRING(source));
|
||||
REQUIRE(VALID_BITSTRING(target));
|
||||
if (source->lsb0) {
|
||||
REQUIRE(sbitpos < source->length);
|
||||
sbitpos = PADDED(source->size) - sbitpos - 1;
|
||||
REQUIRE(sbitpos >= n - 1);
|
||||
sbitpos -= n - 1;
|
||||
REQUIRE(sbitpos <= source->length);
|
||||
sbitpos = PADDED(source->size) - sbitpos;
|
||||
REQUIRE(sbitpos >= n);
|
||||
sbitpos -= n;
|
||||
} else
|
||||
REQUIRE(sbitpos + n <= source->length);
|
||||
tlast = tbitpos + n;
|
||||
if (target->lsb0) {
|
||||
REQUIRE(tbitpos <= target->length);
|
||||
tbitpos = PADDED(target->size) - tbitpos - 1;
|
||||
REQUIRE(tbitpos >= n - 1);
|
||||
tbitpos -= n - 1;
|
||||
tbitpos = PADDED(target->size) - tbitpos;
|
||||
REQUIRE(tbitpos >= n);
|
||||
tbitpos -= n;
|
||||
} else
|
||||
REQUIRE(tlast<= target->size);
|
||||
REQUIRE(tlast <= target->size);
|
||||
|
||||
if (tlast > target->length)
|
||||
target->length = tlast;
|
||||
|
|
|
|||
Loading…
Reference in a new issue