Fix invalid memory access and Unicode support in utils_get_initials()
commit53a42c6de7875b0f112b4ed22eb3f3e1c9cf967c
authorColomban Wendling <ban@herbesfolles.org>
Fri, 19 Apr 2024 21:15:14 +0000 (19 23:15 +0200)
committerColomban Wendling <ban@herbesfolles.org>
Sat, 20 Apr 2024 12:15:32 +0000 (20 14:15 +0200)
tree2f358ccb90bd57bd012ffb42eff80bfb02a99703
parent3f60bdef185421f9d9934f4579b942f78fe82bc3
Fix invalid memory access and Unicode support in utils_get_initials()

Fix utils_get_initials() reading past the end of the input string if
that string was empty.

Also fix support for non-ASCII initials for which the UTF-8 character
representation would have been truncated to the first byte only,
leading to an invalid value.

Fixes #3844.
src/utils.c
tests/test_utils.c