]> git.ipfire.org Git - thirdparty/grub.git/commit
normal/charset: Fix array out-of-bounds formatting unicode for display
authorDaniel Axtens <dja@axtens.net>
Tue, 13 Jul 2021 03:24:38 +0000 (13:24 +1000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 7 Jun 2022 14:39:32 +0000 (16:39 +0200)
commit830a9628b2c9e1b6388af624aaf4a80818ed6be0
treec22487417848f5a9436b1e61cb3713e002e8ec4a
parent22a3f97d39f6a10b08ad7fd1cc47c4dcd10413f6
normal/charset: Fix array out-of-bounds formatting unicode for display

In some cases attempting to display arbitrary binary strings leads
to ASAN splats reading the widthspec array out of bounds.

Check the index. If it would be out of bounds, return a width of 1.
I don't know if that's strictly correct, but we're not really expecting
great display of arbitrary binary data, and it's certainly not worse than
an OOB read.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/normal/charset.c