nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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