The gpt pointer is not initialized, and when offset < 0, it may result in freeing unallocated memory. (#2499)

Signed-off-by: yuxiaojun <yuxiaojun1011@outlook.com>
Co-authored-by: yuxiaojun <yuxiaojun1011@outlook.com>
This commit is contained in:
gcf
2024-05-19 16:27:19 +08:00
committed by GitHub
parent 8723aeb4cc
commit 75cf728fa9

View File

@@ -504,7 +504,7 @@ grub_err_t ventoy_cmd_get_vtoy_type(grub_extcmd_context_t ctxt, int argc, char *
vhd_footer_t vhdfoot;
VDIPREHEADER vdihdr;
char type[16] = {0};
ventoy_gpt_info *gpt;
ventoy_gpt_info *gpt = NULL;
(void)ctxt;