mirror of
https://git.proxmox.com/git/grub2
synced 2025-11-03 18:58:18 +00:00
gfxmenu: Fix double free in load_image()
self->bitmap should be zeroed after free. Otherwise, there is a chance to double free (USE_AFTER_FREE) it later in rescale_image(). Fixes: CID 292472 Signed-off-by: Alexey Makhalov <amakhalov@vmware.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> Patch-Name: gfxmenu-load-image-double-free.patch
This commit is contained in:
parent
fcc11dc1e6
commit
e283bb2503
@ -195,7 +195,10 @@ load_image (grub_gui_image_t self, const char *path)
|
||||
return grub_errno;
|
||||
|
||||
if (self->bitmap && (self->bitmap != self->raw_bitmap))
|
||||
grub_video_bitmap_destroy (self->bitmap);
|
||||
{
|
||||
grub_video_bitmap_destroy (self->bitmap);
|
||||
self->bitmap = 0;
|
||||
}
|
||||
if (self->raw_bitmap)
|
||||
grub_video_bitmap_destroy (self->raw_bitmap);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user