X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/e8a25e05698e39a45cf5f188476808ef3609dbdd..e4e3d18dad8b9b8560889f552e1060d0f83c7159:/src/src/base64.c diff --git a/src/src/base64.c b/src/src/base64.c index 289383b66..29f9c77b0 100644 --- a/src/src/base64.c +++ b/src/src/base64.c @@ -6,6 +6,7 @@ /* License: GPL */ /* Copyright (c) University of Cambridge 1995 - 2018 */ +/* Copyright (c) The Exim Maintainers 2020 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -158,7 +159,7 @@ uschar *result; { int l = Ustrlen(code); - *ptr = result = store_get(1 + l/4 * 3 + l%4); + *ptr = result = store_get(1 + l/4 * 3 + l%4, is_tainted(code)); } /* Each cycle of the loop handles a quantum of 4 input bytes. For the last @@ -242,9 +243,9 @@ static uschar *enc64table = US"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; uschar * -b64encode(const uschar * clear, int len) +b64encode_taint(const uschar * clear, int len, BOOL tainted) { -uschar *code = store_get(4*((len+2)/3) + 1); +uschar *code = store_get(4*((len+2)/3) + 1, tainted); uschar *p = code; while (len-- >0) @@ -283,6 +284,12 @@ while (len-- >0) return code; } +uschar * +b64encode(const uschar * clear, int len) +{ +return b64encode_taint(clear, len, is_tainted(clear)); +} + /* End of base64.c */ /* vi: sw ai sw=2