mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
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]
This commit is contained in:
@@ -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.33 2009/10/21 01:22:29 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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user