From 87d62d7d29a03be977388a01b330cd6332b6d3fd Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 11 Nov 2013 00:06:52 +0100 Subject: [PATCH] * grub-core/loader/i386/coreboot/chainloader.c (load_segment): Use right buffer for temporary load. --- ChangeLog | 5 +++++ grub-core/loader/i386/coreboot/chainloader.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 245b2702e..c06aa81ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-10 Vladimir Serbinenko + + * grub-core/loader/i386/coreboot/chainloader.c (load_segment): Use + right buffer for temporary load. + 2013-11-10 Vladimir Serbinenko * grub-core/loader/i386/coreboot/chainloader.c: Support tianocore. diff --git a/grub-core/loader/i386/coreboot/chainloader.c b/grub-core/loader/i386/coreboot/chainloader.c index 6e1bd9830..d4cc40b7f 100644 --- a/grub-core/loader/i386/coreboot/chainloader.c +++ b/grub-core/loader/i386/coreboot/chainloader.c @@ -162,7 +162,7 @@ load_segment (grub_file_t file, const char *filename, buf = grub_malloc (*size); if (!buf) return grub_errno; - if (grub_file_read (file, load_addr, *size) + if (grub_file_read (file, buf, *size) != (grub_ssize_t) *size) { if (!grub_errno) @@ -187,6 +187,8 @@ load_segment (grub_file_t file, const char *filename, /* ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc)*/ grub_free (buf); + grub_dprintf ("chain", "%x, %x, %x, %x\n", + insize, src_len, outsize, dst_len); if (res != SZ_OK || src_len != insize || dst_len != outsize) return grub_error (GRUB_ERR_BAD_OS, "decompression failure %d", res);