font: Do not load more than one NAME section
commit89f3da1a3d14023eda182e075919dd584031ecad
authorDaniel Kiper <daniel.kiper@oracle.com>
Tue, 7 Jul 2020 13:36:26 +0000 (7 15:36 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 29 Jul 2020 14:55:48 +0000 (29 16:55 +0200)
tree2ff474844fe8f18e84d290b34a046bed2d3d9576
parent2a1edcf2ede865b60604815d3bc5c01029379ca4
font: Do not load more than one NAME section

The GRUB font file can have one NAME section only. Though if somebody
crafts a broken font file with many NAME sections and loads it then the
GRUB leaks memory. So, prevent against that by loading first NAME
section and failing in controlled way on following one.

Reported-by: Chris Coulson <chris.coulson@canonical.com>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Jan Setje-Eilers <jan.setjeeilers@oracle.com>
grub-core/font/font.c