diff options
author | Cy Schubert <cy@FreeBSD.org> | 2014-12-20 22:52:39 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2014-12-20 22:52:39 +0000 |
commit | b5e14a1344528861a7016aa2c6b0f2e9630d1526 (patch) | |
tree | f04bed14f7e8aed5c0e9d2f7785175c7951036d3 /lib/isc/base64.c | |
parent | 2b45e011ca352ce509bc83ae148230aeee0c7e0d (diff) |
Diffstat (limited to 'lib/isc/base64.c')
-rw-r--r-- | lib/isc/base64.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/isc/base64.c b/lib/isc/base64.c index 13ed6b5c5c17..bad1565bea7b 100644 --- a/lib/isc/base64.c +++ b/lib/isc/base64.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -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.34 2009/10/21 23:48:05 tbox 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); } @@ -217,7 +219,7 @@ isc_base64_decodestring(const char *cstr, isc_buffer_t *target) { continue; RETERR(base64_decode_char(&ctx, c)); } - RETERR(base64_decode_finish(&ctx)); + RETERR(base64_decode_finish(&ctx)); return (ISC_R_SUCCESS); } |