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

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