diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2021-08-26 23:53:14 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2021-08-26 23:53:14 +0200 |
commit | 8001d09a9b418e83771813750532b0a29a89847f (patch) | |
tree | d660b22fc0e8681ad8ef9908b71d0de8b44cfe1f /base64.c | |
parent | 84580ab863845586828269ebc7c3d0ad9376b3e3 (diff) | |
download | fetchmail-8001d09a9b418e83771813750532b0a29a89847f.tar.gz fetchmail-8001d09a9b418e83771813750532b0a29a89847f.tar.bz2 fetchmail-8001d09a9b418e83771813750532b0a29a89847f.zip |
IMAP: fix base64 length calc. for AUTH=EXTERNAL
to make code more correct or readable; to64frombits does not overflow its buffer
Diffstat (limited to 'base64.c')
-rw-r--r-- | base64.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -27,6 +27,11 @@ static const char base64val[] = { }; #define DECODE64(c) (isascii((unsigned char)(c)) ? base64val[c] : BAD) +unsigned len64frombits(unsigned inlen) +{ + return (inlen + 2)/3*4; +} + int to64frombits(char *out, const void *in_, int inlen, size_t outlen) /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */ { |