]> git.ipfire.org Git - thirdparty/grub.git/commit
font: Check return value of grub_malloc() in ascii_glyph_lookup()
authorZhang Boyang <zhangboyang.id@gmail.com>
Mon, 5 Dec 2022 11:29:36 +0000 (19:29 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 10 Jan 2023 15:01:01 +0000 (16:01 +0100)
commitd7ed2ebcd69df123fde8ae1ba9163e2b93c47bbf
treeadd89c4309d46ba1ac4ae1d90c44ebda6e45c749
parent5464e31a4e978a22b9da1d7201f498040ff25bb3
font: Check return value of grub_malloc() in ascii_glyph_lookup()

There is a problem in ascii_glyph_lookup(). It doesn't check the return
value of grub_malloc(). If memory can't be allocated, then NULL pointer
will be written to.

This patch fixes the problem by fallbacking to unknown_glyph when
grub_malloc() returns NULL.

Signed-off-by: Zhang Boyang <zhangboyang.id@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/font/font.c