]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: iso9660: allocate enough space for UTF16 decoding
authorThomas Weißschuh <thomas@t-8ch.de>
Thu, 10 Nov 2022 18:48:20 +0000 (19:48 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 15 Nov 2022 16:43:41 +0000 (17:43 +0100)
commit32bd447fd7d0933c5aecac75cc1823b3ee897f11
tree73b0009c667ea88c8708d2dd2f35030ad5862f49
parent9c82a8ca123a4e4028d51f4e38c7c3cfbdc74711
libblkid: iso9660: allocate enough space for UTF16 decoding

When merge_utf16be_ascii() encounters high-codepoint surrogate pairs it
emits four bytes of output for one byte of ascii input.
In addition with the remaining ascii characters from the second loop we
need up to 5 * sizeof(input) / 2 bytes as output buffer.

As we decode up to 128 ascii characters with merge_utf16be_ascii() we
need 320 bytes of buffer available.

Furthermore adapt merge_utf16be_ascii() to not write paste the output
buffer end.

Fix OSS-Fuzz issue 53149 ( #1887 )
libblkid/src/superblocks/iso9660.c
tests/ts/fuzzers/test_blkid_fuzz_files/oss-fuzz-53149 [new file with mode: 0644]