7c1b72e1a0b35aa27d4f74e9dd49fc3156eb4fa9 |
|
01-Jun-2015 |
Phil Carmody <phil@dovecot.fi> |
lib: test-unichar - test invalid utf8 encodings
Chop trailing characters off valid encodings, and watch them fail.
(There's no need to do this on most of the test characters, as they're
truncated to the same byte sequence - only do 1 in 64.)
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
5fea87f050d4a6a8c8a3b259a25541fc78e5f2cd |
|
01-Jun-2015 |
Phil Carmody <phil@dovecot.fi> |
lib: test-unichar - streamline the unichars test
It's doing 2 kinds of tests, split them into separate test cases.
And the first part has started to get expensive, so just make sure
all code paths are tested by skipping most values. Only 3 from each
set of 64 (lowest 6 bits) are tested.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
32ae620015da6ab2ec28e04d3cdcdb4420f1fa6b |
|
15-Jan-2015 |
Timo Sirainen <tss@iki.fi> |
lib: Fixed NUL-handling in uni_utf8_*strlen*()
uni_utf8_strlen() could have skipped over the ending NUL byte and caused
read buffer overflows with invalid input.
uni_utf8_strlen_n() and uni_utf8_partial_strlen_n() now allow NUL bytes in
the input and they're treated as regular control characters. Previously the
size was actually treated as max_size with early NUL byte termination.
Technically this is an API change, but I'm not aware of anything using these
functions in an incompatible way. |