]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2723. [bug] isc_base32_totext(), isc_base32hex_totext(), and
authorEvan Hunt <each@isc.org>
Wed, 21 Oct 2009 01:22:47 +0000 (01:22 +0000)
committerEvan Hunt <each@isc.org>
Wed, 21 Oct 2009 01:22:47 +0000 (01:22 +0000)
isc_base64_totext(), didn't always mark regions of
memory as fully consumed after conversion.  [RT #20445]

CHANGES
lib/isc/base32.c
lib/isc/base64.c

diff --git a/CHANGES b/CHANGES
index 22727d66a0197cc20111dc6d4df2a287a4ec2a52..a9ee5a5faf82b44988977b1814da25714028e252 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+2723.  [bug]           isc_base32_totext(), isc_base32hex_totext(), and
+                       isc_base64_totext(), didn't always mark regions of
+                       memory as fully consumed after conversion.  [RT #20445]
+
 2722.  [bug]           Ensure that the memory associated with the name of
                        a node in a rbt tree is not altered during the life
                        of the node. [RT #20431]
index 3000a84f2da14b9f1f10724d69993cc5abc5983a..d324da9760ae3c3ef7612855622afa75a83c778f 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: base32.c,v 1.3.116.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: base32.c,v 1.3.116.3 2009/10/21 01:22:47 each Exp $ */
 
 /*! \file */
 
@@ -112,6 +112,8 @@ base32_totext(isc_region_t *source, int wordlength, const char *wordbreak,
                        RETERR(str_totext(wordbreak, target));
                }
        }
+       if (source->length > 0)
+               isc_region_consume(source, source->length);
        return (ISC_R_SUCCESS);
 }
 
index 13ed6b5c5c170af346359046dd4240965497891b..491c3b1d7ed7775046168661c1aaadd5e3e3a025 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: base64.c,v 1.32 2007/06/19 23:47:17 tbox Exp $ */
+/* $Id: base64.c,v 1.32.332.1 2009/10/21 01:22:47 each Exp $ */
 
 /*! \file */
 
@@ -85,11 +85,13 @@ isc_base64_totext(isc_region_t *source, int wordlength,
                buf[2] = base64[((source->base[1]<<2)&0x3c)];
                buf[3] = '=';
                RETERR(str_totext(buf, target));
+               isc_region_consume(source, 2);
        } else if (source->length == 1) {
                buf[0] = base64[(source->base[0]>>2)&0x3f];
                buf[1] = base64[((source->base[0]<<4)&0x30)];
                buf[2] = buf[3] = '=';
                RETERR(str_totext(buf, target));
+               isc_region_consume(source, 1);
        }
        return (ISC_R_SUCCESS);
 }