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;