From: Evan Hunt Date: Wed, 21 Oct 2009 01:23:19 +0000 (+0000) Subject: 2723. [bug] isc_base64_totext() didn't always mark regions of X-Git-Tag: v9.5.2-P1~1^5~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5604faa1297f5bb39affa4b3fe51d3adf010a7b1;p=thirdparty%2Fbind9.git 2723. [bug] isc_base64_totext() didn't always mark regions of memory as fully consumed after conversion. [RT #20445] --- diff --git a/CHANGES b/CHANGES index 7ce73e794fc..c2d64530b4b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2723. [bug] 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] diff --git a/lib/isc/base64.c b/lib/isc/base64.c index 13ed6b5c5c1..71fca2704ef 100644 --- a/lib/isc/base64.c +++ b/lib/isc/base64.c @@ -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.128.1 2009/10/21 01:23:19 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); }