]> git.ipfire.org Git - thirdparty/grub.git/commit
util/grub-mkfont: Fix tainted loop boundary issues with substitutions
authorDarren Kenny <darren.kenny@oracle.com>
Thu, 7 Jul 2022 15:34:38 +0000 (15:34 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 12 Jul 2022 12:29:38 +0000 (14:29 +0200)
commitb6a2ea4f8267b893b95bd42528c92391dc6fcf4c
tree680c1c1cae03f2cf7e492c5f33ed0d41f14f0863
parent58de1fcec226eb0622305213aeec61ec02438c1f
util/grub-mkfont: Fix tainted loop boundary issues with substitutions

With gsub substitutions the offsets should be validated against the
number of glyphs in a font face and the memory allocated for the gsub
substitution data.

Both the number of glyphs and the last address in the allocated data are
passed in to process_cursive(), where the number of glyphs validates the end
of the range.

Enabling memory allocation validation uses two macros, one to simply check the
address against the allocated space, and the other to check that the number of
items of a given size doesn't extend outside of the allocated space.

Fixes: CID 73770
Fixes: CID 314040
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-mkfont.c