From 668ea6d26d161211782b4f37b3692d80b988033d Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 8 May 2012 14:22:38 +0200 Subject: [PATCH] * grub-core/commands/hashsum.c (grub_cmd_hashsum): Align space for resulting hash as a precaution. --- ChangeLog | 5 +++++ grub-core/commands/hashsum.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdb1e3108..d4694dd75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-08 Vladimir Serbinenko + + * grub-core/commands/hashsum.c (grub_cmd_hashsum): Align space for + resulting hash as a precaution. + 2012-05-08 Vladimir Serbinenko * grub-core/net/bootp.c (set_env_limn_ro): Replace reserved ':' with diff --git a/grub-core/commands/hashsum.c b/grub-core/commands/hashsum.c index 44d7cbe17..ba33ea294 100644 --- a/grub-core/commands/hashsum.c +++ b/grub-core/commands/hashsum.c @@ -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]); }