mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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:
parent
c636dc4381
commit
c8268a9fbc
1 changed files with 4 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue