[2432] 2009-07-20 Vladimir Serbinenko <[email protected]>

Vladimir Serbinenko <[email protected]> Mon, 20 Jul 2009 17:37:38 +0000
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2432
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2432
Author:   phcoder
Date:     2009-07-20 17:37:37 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
2009-07-20  Vladimir Serbinenko  <[email protected]>

	* font/font.c (find_glyph): Check whether a font is present to avoid
	segmentation fault.
	

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/font/font.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-07-20 16:46:36 UTC (rev 2431)
+++ trunk/grub2/ChangeLog	2009-07-20 17:37:37 UTC (rev 2432)
@@ -1,3 +1,8 @@
+2009-07-20  Vladimir Serbinenko  <[email protected]>
+
+	* font/font.c (find_glyph): Check whether a font is present to avoid
+	segmentation fault.
+	
 2009-07-20  Joe Auricchio <[email protected]>
 
 	* term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen.

Modified: trunk/grub2/font/font.c
===================================================================
--- trunk/grub2/font/font.c	2009-07-20 16:46:36 UTC (rev 2431)
+++ trunk/grub2/font/font.c	2009-07-20 17:37:37 UTC (rev 2432)
@@ -607,6 +607,9 @@
   lo = 0;
   hi = font->num_chars - 1;
 
+  if (! table)
+    return 0;
+
   while (lo <= hi)
     {
       mid = lo + (hi - lo) / 2;