diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-06-02 17:08:46 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | 370e2cb260e7d8d063e00f6917e76952131ec741 (patch) | |
tree | cb81aad6294e95ecd3b474c538e29e06a57564dd /src/test/test-string-util.c | |
parent | f39f1b81b67bbe5137bdc87e76076407bd77f0c3 (diff) |
test-ellipsize: add tests for ellipsize_mem, fix bugs
First, ellipsize() and ellipsize_mem() should not read past the input
buffer. Those functions take an explicit length for the input data, so they
should not assume that the buffer is terminated by a nul.
Second, ellipsization was off in various cases where wide on multi-byte
characters were used.
We had some basic test for ellipsize(), but apparently it wasn't enough to
catch more serious cases.
Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8686.
Diffstat (limited to 'src/test/test-string-util.c')
-rw-r--r-- | src/test/test-string-util.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c index 4ff792c4c..5df49ab07 100644 --- a/src/test/test-string-util.c +++ b/src/test/test-string-util.c @@ -10,6 +10,7 @@ #include "macro.h" #include "string-util.h" #include "strv.h" +//#include "utf8.h" static void test_string_erase(void) { char *x; |