Leah Neukirchen
3c3c175086
rfc2047: blaze822_decode_rfc2047: fix memory leak of srcenc
7 years ago
Leah Neukirchen
4fef01ab6d
rfc2047: blaze822_decode_rfc2047: check for NUL bytes at the very end of decoding
7 years ago
Leah Neukirchen
ba4a0cf589
rfc2047: blaze822_decode_rfc2047: don't decode encoded-words that contain NUL bytes
...
This is a lax interpretation of RFC 2047, 4.5:
> Only printable and white space character data should be encoded using
> this scheme. However, since these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects.
Since many of the code that deals with header values does not support
inline NUL bytes, it's best to not decode them here.
We check for this after iconv, so quoted-printable UTF-32 e.g. should be
safe.
Also see https://www.mailsploit.com/
7 years ago
Leah Neukirchen
e6239ef353
rfc2047: blaze822_decide_rfc2047: ensure enough space for NUL-termination
...
Closes #76 .
7 years ago
Leah Neukirchen
5f45b7d533
use appropriate integer types
...
Mainly found with clang -Wconversion -Wshorten-64-to-32.
7 years ago
Leah Neukirchen
5ff71ace36
rfc2047: blaze822_decode_qp: decode invalid qp-codes as literal
7 years ago
Leah Neukirchen
66d0eff12f
style
7 years ago
Leah Neukirchen
3b51c5938a
rfc2047: blaze822_decode_b64: ensure nul-termination of result
...
Fixes #70 .
7 years ago
Leah Neukirchen
36faf7f114
rfc2047: blaze822_decode_rfc2047: ignore RFC 2231 language tag
8 years ago
Christian Neukirchen
40b19264c5
rfc2047: only decode _ as spaces when decoding headers
8 years ago
Christian Neukirchen
b336acc23c
rfc2047: blaze822_decode_qp: don't waste 75% memory
8 years ago
Christian Neukirchen
27915af60d
rfc2047: detect partial multibyte sequences and decode them correctly
8 years ago
Christian Neukirchen
a1ed8d7b6c
rfc2047: blaze822_decode_qp: skip =CRLF
8 years ago
Christian Neukirchen
525233811c
rfc2047: allow empty encoded-words
...
This is non-conforming, but happens in the wild occasionally.
8 years ago
Christian Neukirchen
a82cb18ccc
rfc2047: blaze822_decode_rfc2047: initialize dec and decchunk.
...
Found by clang-analyzer.
8 years ago
Christian Neukirchen
22f456a2a0
clean up header includes
8 years ago
Christian Neukirchen
54b93c8f63
rfc2047: decode ??? on errors
8 years ago
Christian Neukirchen
8629e12ee6
rfc2047: revert in blaze822_decode_b64
8 years ago
Christian Neukirchen
010458d971
rfc2047: try sliced version of blaze822_decode_b64 (no benefit in practise)
8 years ago
Christian Neukirchen
00b0e23f1f
rfc2047: blaze822_decode_b64: check bounds
8 years ago
Christian Neukirchen
1a1f01ecf9
rfc2047: blaze822_decode_qp: check bounds
8 years ago
Christian Neukirchen
11c9ce78f1
rfc2047: blaze822_decode_qp: off-by-one in qp decoding
8 years ago
Christian Neukirchen
6e6d1993a2
rfc2047: free all things in blaze822_decode_rfc2047
8 years ago
Christian Neukirchen
b32ef0fd5a
blaze822_priv.h: add isfws
8 years ago
Christian Neukirchen
8ba55bae99
blaze822_priv.h: macro cleanup
8 years ago
Christian Neukirchen
17355dbe63
blaze822: api refactoring
8 years ago
Christian Neukirchen
9b2a97416d
rfc2047: detect iconv_open error properly
8 years ago
Christian Neukirchen
56a30a4068
rfc2047: suppress common error messages
8 years ago
Christian Neukirchen
3d40dedd96
rfc2047: consistency
8 years ago
Christian Neukirchen
4bd036232d
rfc2047: better base64 memory bound
8 years ago
Christian Neukirchen
bd1ab50db8
rfc2047: avoid tolower
8 years ago
Christian Neukirchen
cd510df51d
rfc2047: handle uint properly
8 years ago
Christian Neukirchen
3ce49fb460
fix unsigned computation
8 years ago
Christian Neukirchen
3bb5452964
add rfc2047 decoder
8 years ago