From 954f7bf5ecce153de2c6d17da87543e406931006 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 28 Oct 2013 14:25:22 +0100 Subject: [PATCH] * grub-core/loader/xnu_resume.c (grub_xnu_resume): Reject empty images. --- ChangeLog | 4 ++++ grub-core/loader/xnu_resume.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 510d3a032..4b69844d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-10-28 Vladimir Serbinenko + + * grub-core/loader/xnu_resume.c (grub_xnu_resume): Reject empty images. + 2013-10-28 Francesco Lavra * grub-core/lib/fdt.c: Fix miscellaneous bugs. diff --git a/grub-core/loader/xnu_resume.c b/grub-core/loader/xnu_resume.c index e99ea142e..534a74438 100644 --- a/grub-core/loader/xnu_resume.c +++ b/grub-core/loader/xnu_resume.c @@ -83,6 +83,13 @@ grub_xnu_resume (char *imagename) "encrypted images aren't supported yet"); } + if (hibhead.image_size == 0) + { + grub_file_close (file); + return grub_error (GRUB_ERR_BAD_OS, + "hibernate image is empty"); + } + codedest = hibhead.launchcode_target_page; codedest *= GRUB_XNU_PAGESIZE; codesize = hibhead.launchcode_numpages;