Blame SOURCES/0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch

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