diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c index f8c182f8c42..b328d214b21 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c @@ -342,10 +342,12 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) if (len == 0) return 0; - if (grub_strncmp(file->name, GRUB_MEMFILE_MEM, grub_strlen(GRUB_MEMFILE_MEM)) == 0) { + if (file->name) { + if (grub_strncmp(file->name, GRUB_MEMFILE_MEM, grub_strlen(GRUB_MEMFILE_MEM)) == 0) { grub_memcpy(buf, (grub_uint8_t *)(file->data) + file->offset, len); file->offset += len; return len; + } } read_hook = file->read_hook;