]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/commands/hashsum.c (grub_cmd_hashsum): Align space for
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 8 May 2012 12:22:38 +0000 (14:22 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 8 May 2012 12:22:38 +0000 (14:22 +0200)
resulting hash as a precaution.

ChangeLog
grub-core/commands/hashsum.c

index bdb1e31082f46859942b391688abf3f4a9c675f1..d4694dd75711ba2df172a1e654e7bb7fdeae2b25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-08  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/commands/hashsum.c (grub_cmd_hashsum): Align space for
+       resulting hash as a precaution.
+
 2012-05-08  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/net/bootp.c (set_env_limn_ro): Replace reserved ':' with
index 44d7cbe1789d58c65f7b0f67891e949085b41486..ba33ea2940e4ffe23609c942438b14ef3e5e475d 100644 (file)
@@ -218,7 +218,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
 
   for (i = 0; i < (unsigned) argc; i++)
     {
-      grub_uint8_t result[hash->mdlen];
+      GRUB_PROPERLY_ALIGNED_ARRAY (result, hash->mdlen);
       grub_file_t file;
       grub_err_t err;
       unsigned j;
@@ -246,7 +246,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
          continue;
        }
       for (j = 0; j < hash->mdlen; j++)
-       grub_printf ("%02x", result[j]);
+       grub_printf ("%02x", ((grub_uint8_t *) result)[j]);
       grub_printf ("  %s\n", args[i]);
     }