From 57a55913e0edfee615c6007e44ae8a9def785d95 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 20 Jul 2009 17:37:37 +0000 Subject: [PATCH] 2009-07-20 Vladimir Serbinenko * font/font.c (find_glyph): Check whether a font is present to avoid segmentation fault. --- ChangeLog | 5 +++++ font/font.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index c9616e25c..cd29ffcb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-20 Vladimir Serbinenko + + * font/font.c (find_glyph): Check whether a font is present to avoid + segmentation fault. + 2009-07-20 Joe Auricchio * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. diff --git a/font/font.c b/font/font.c index 84f0a4260..a81291916 100644 --- a/font/font.c +++ b/font/font.c @@ -607,6 +607,9 @@ find_glyph (const grub_font_t font, grub_uint32_t code) lo = 0; hi = font->num_chars - 1; + if (! table) + return 0; + while (lo <= hi) { mid = lo + (hi - lo) / 2;