Skip to content

Commit

Permalink
fix Synchronous Exception on some arm cpus (#2488)
Browse files Browse the repository at this point in the history
  • Loading branch information
amazingfate authored Jul 20, 2023
1 parent 430f81a commit 529541f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 529541f

Please sign in to comment.