grub2/grub-core/term
Daniel Axtens 829329bddb term/gfxterm: Don't set up a font with glyphs that are too big
Catch the case where we have a font so big that it causes the number of
rows or columns to be 0. Currently we continue and allocate a
virtual_screen.text_buffer of size 0. We then try to use that for glpyhs
and things go badly.

On the emu platform, malloc() may give us a valid pointer, in which case
we'll access heap memory which we shouldn't. Alternatively, it may give us
NULL, in which case we'll crash. For other platforms, if I understand
grub_memalign() correctly, we will receive a valid but small allocation
that we will very likely later overrun.

Prevent the creation of a virtual screen that isn't at least 40 cols
by 12 rows. This is arbitrary, but it seems that if your width or height
is half a standard 80x24 terminal, you're probably going to struggle to
read anything anyway.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-03-02 15:54:18 +01:00
..
arc * grub-core/term/arc/console.c: Add missing cast to silence warning. 2013-11-24 05:05:34 +01:00
arm arm/term: Fix linking error due multiple ps2_state definitions 2020-12-11 13:53:54 +01:00
efi efi/console: Do not set text-mode until we actually need it 2020-04-21 22:13:14 +02:00
i386 core: use GRUB_TERM_ definitions when handling term characters 2017-08-07 19:28:22 +02:00
ieee1275 * grub-core/term/ieee1275/escc.c (GRUB_MOD_INIT): Fix order of channels. 2013-11-10 17:53:11 +01:00
uboot Add progress module to display load progress of files. 2013-10-22 16:42:20 -02:00
xen Remove xen VFB. 2013-12-18 18:43:09 +01:00
at_keyboard.c at_keyboard: Fix unreliable key presses 2019-10-21 14:07:47 +02:00
gfxterm_background.c Detach optional parts of gfxterm and integrate in with coreboot init. 2013-05-31 00:42:33 +02:00
gfxterm.c term/gfxterm: Don't set up a font with glyphs that are too big 2021-03-02 15:54:18 +01:00
morse.c Add progress module to display load progress of files. 2013-10-22 16:42:20 -02:00
ns8250.c Avoid division by zero in serial. 2015-01-21 17:42:13 +01:00
ps2.c at_keyboard: Split protocol from controller code. 2017-05-08 21:41:22 +02:00
serial.c misc: Make grub_strtol() "end" pointers have safer const qualifiers 2020-02-28 12:41:29 +01:00
spkmodem.c Add progress module to display load progress of files. 2013-10-22 16:42:20 -02:00
terminfo.c term: Fix overflow on user inputs 2020-07-29 16:55:48 +02:00
tparm.c Enable -Wformat=2 if it's supported. 2013-12-21 15:28:28 +01:00
usb_keyboard.c usb_keyboard: Remove useless include 2016-02-22 20:05:54 +01:00