fs/zfs: Add missing NULL check after grub_strdup() call
authorLidong Chen <lidong.chen@oracle.com>
Wed, 22 Jan 2025 07:17:04 +0000 (07:17 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-zfs-Add-missing-NULL-check-after-grub_strdup-call.patch

grub-core/fs/zfs/zfs.c

index 6e6d1c92149f2a9b6c7f4d151f7a91c3b60a3fae..5ff647ffbb53569d59ff8e059993c5c6cf57a199 100644 (file)
@@ -3309,6 +3309,8 @@ dnode_get_fullpath (const char *fullpath, struct subvolume *subvol,
       filename = 0;
       snapname = 0;
       fsname = grub_strdup (fullpath);
+      if (!fsname)
+       return grub_errno;
     }
   else
     {