011fe81
From 473348e663de53939fc077a1e1ef262405712dd8 Mon Sep 17 00:00:00 2001
011fe81
From: Trevor Woerner <trevor.woerner@linaro.org>
011fe81
Date: Sat, 21 Jun 2014 20:26:47 +0200
58fe9aa
Subject: [PATCH 083/152] 	* util/grub-gen-asciih.c (add_glyph): Fix
011fe81
 uninitialised variable.
011fe81
011fe81
---
011fe81
 ChangeLog              |  4 ++++
011fe81
 util/grub-gen-asciih.c | 15 +++++++++------
011fe81
 2 files changed, 13 insertions(+), 6 deletions(-)
011fe81
011fe81
diff --git a/ChangeLog b/ChangeLog
011fe81
index 2a94ad9..b552113 100644
011fe81
--- a/ChangeLog
011fe81
+++ b/ChangeLog
011fe81
@@ -1,3 +1,7 @@
011fe81
+2014-06-21  Trevor Woerner <trevor.woerner@linaro.org>
011fe81
+
011fe81
+	* util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable.
011fe81
+
011fe81
 2014-06-21  Vladimir Serbinenko  <phcoder@gmail.com>
011fe81
 
011fe81
 	* grub-core/commands/verify.c (grub_pubkey_open): Trust procfs.
011fe81
diff --git a/util/grub-gen-asciih.c b/util/grub-gen-asciih.c
011fe81
index e01447a..e35dcb7 100644
011fe81
--- a/util/grub-gen-asciih.c
011fe81
+++ b/util/grub-gen-asciih.c
011fe81
@@ -81,14 +81,14 @@ add_glyph (FT_UInt glyph_idx, FT_Face face,
011fe81
   err = FT_Load_Glyph (face, glyph_idx, flag);
011fe81
   if (err)
011fe81
     {
011fe81
-      printf ("Freetype Error %d loading glyph 0x%x for U+0x%x",
011fe81
+      fprintf (stderr, "Freetype Error %d loading glyph 0x%x for U+0x%x",
011fe81
 	      err, glyph_idx, char_code);
011fe81
 
011fe81
       if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))
011fe81
-	printf (": %s\n", ft_errmsgs[err]);
011fe81
+	fprintf (stderr, ": %s\n", ft_errmsgs[err]);
011fe81
       else
011fe81
-	printf ("\n");
011fe81
-      return;
011fe81
+	fprintf (stderr, "\n");
011fe81
+      exit (1);
011fe81
     }
011fe81
 
011fe81
   glyph = face->glyph;
011fe81
@@ -128,7 +128,6 @@ add_glyph (FT_UInt glyph_idx, FT_Face face,
011fe81
 static void
011fe81
 write_font_ascii_bitmap (FILE *file, FT_Face face)
011fe81
 {
011fe81
-  struct grub_glyph_info glyph;
011fe81
   int char_code;
011fe81
 
011fe81
   fprintf (file, "/* THIS CHUNK OF BYTES IS AUTOMATICALLY GENERATED */\n");
011fe81
@@ -138,10 +137,14 @@ write_font_ascii_bitmap (FILE *file, FT_Face face)
011fe81
   for (char_code = 0; char_code <= 0x7f; char_code++)
011fe81
     {
011fe81
       FT_UInt glyph_idx;
011fe81
-      
011fe81
+      struct grub_glyph_info glyph;
011fe81
+
011fe81
       glyph_idx = FT_Get_Char_Index (face, char_code);
011fe81
       if (!glyph_idx)
011fe81
 	return;
011fe81
+
011fe81
+      memset (&glyph, 0, sizeof(glyph));
011fe81
+
011fe81
       add_glyph (glyph_idx, face, char_code, &glyph);
011fe81
 
011fe81
       if (glyph.width == 8 && glyph.height == 16
011fe81
-- 
37b39b7
1.9.3
011fe81