mirror of
https://git.proxmox.com/git/grub2
synced 2025-08-14 14:42:39 +00:00
loader/xnu: Check if pointer is NULL before using it
Fixes: CID 73654 Signed-off-by: Paulo Flabiano Smorigo <pfsmorigo@canonical.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
4b4027b6b1
commit
7c8a2b5d14
@ -670,6 +670,9 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile,
|
|||||||
char *name, *nameend;
|
char *name, *nameend;
|
||||||
int namelen;
|
int namelen;
|
||||||
|
|
||||||
|
if (infoplistname == NULL)
|
||||||
|
return grub_error (GRUB_ERR_BAD_FILENAME, N_("missing p-list filename"));
|
||||||
|
|
||||||
name = get_name_ptr (infoplistname);
|
name = get_name_ptr (infoplistname);
|
||||||
nameend = grub_strchr (name, '/');
|
nameend = grub_strchr (name, '/');
|
||||||
|
|
||||||
@ -701,10 +704,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile,
|
|||||||
else
|
else
|
||||||
macho = 0;
|
macho = 0;
|
||||||
|
|
||||||
if (infoplistname)
|
infoplist = grub_file_open (infoplistname, GRUB_FILE_TYPE_XNU_INFO_PLIST);
|
||||||
infoplist = grub_file_open (infoplistname, GRUB_FILE_TYPE_XNU_INFO_PLIST);
|
|
||||||
else
|
|
||||||
infoplist = 0;
|
|
||||||
grub_errno = GRUB_ERR_NONE;
|
grub_errno = GRUB_ERR_NONE;
|
||||||
if (infoplist)
|
if (infoplist)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user