base64_decode() was feeding \r and \n to the decoding function, and that

was causing output to be corrupted.

Pointed out by:	obrien
MFC after:	3 days
This commit is contained in:
Juli Mallett 2002-04-20 02:33:30 +00:00
parent c636dc4381
commit c8268a9fbc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95101

View file

@ -342,6 +342,10 @@ base64_decode(stream)
unsigned char out[MAXPATHLEN * 4];
int rv;
if (index(stream, '\r') != NULL)
*index(stream, '\r') = '\0';
if (index(stream, '\n') != NULL)
*index(stream, '\n') = '\0';
rv = b64_pton(stream, out, (sizeof(out) / sizeof(out[0])));
if (rv == -1)
errx(1, "b64_pton: error decoding base64 input stream");