From e709ebe2ef8fc4b64fcf092744a3edd6bba2c9eb Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 27 Jan 2010 16:29:21 +0100 Subject: [PATCH] 2010-01-27 Vladimir Serbinenko * commands/hashsum.c (hash_file): Avoid possible stack overflow by having a 4KiB and not 32KiB buffer size. --- ChangeLog | 5 +++++ commands/hashsum.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 60ce328bf..aceb55009 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-27 Vladimir Serbinenko + + * commands/hashsum.c (hash_file): Avoid possible stack overflow by + having a 4KiB and not 32KiB buffer size. + 2010-01-27 Robert Millan * util/hostfs.c: Include `'. diff --git a/commands/hashsum.c b/commands/hashsum.c index a4e71b844..951479fa7 100644 --- a/commands/hashsum.c +++ b/commands/hashsum.c @@ -57,7 +57,7 @@ static grub_err_t hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result) { grub_uint8_t context[hash->contextsize]; - char *readbuf[4096]; + grub_uint8_t readbuf[4096]; grub_memset (context, 0, sizeof (context)); hash->init (context);