]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Tue, 12 Sep 2000 23:29:25 +0000 (23:29 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 12 Sep 2000 23:29:25 +0000 (23:29 +0000)
445.   [bug]           Doing a 0 bit isc_bitstring_copy() of an lsb0
                        bitstring triggered a REQUIRE statement.  The REQUIRE
                        statement was incorrect. [RT #297]

CHANGES
lib/isc/bitstring.c

diff --git a/CHANGES b/CHANGES
index 53198f05e30aa97b7e32810f469a9ce3918fb3b7..120a559a8cfea7845396a500984efcd27dd29584 100644 (file)
--- a/CHANGES
+++ b/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]
+
  443.  [bug]           When loading a master file failed because of an
                        unrecognized RR type name, the error message
                        did not include the file name and line number. 
index f4b30cf357c681defaacfe22f377dd94462a3008..d87e68f5acdb63617a2080d35cb4c95e2843c01d 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: bitstring.c,v 1.5 2000/06/22 21:56:50 tale Exp $ */
+/* $Id: bitstring.c,v 1.5.2.1 2000/09/12 23:29:25 gson 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;