]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
ZFS: Fix invalid memcmp
authorVladimir Serbinenko <phcoder@gmail.com>
Thu, 6 Jul 2023 15:12:09 +0000 (17:12 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 18 Sep 2023 00:43:32 +0000 (02:43 +0200)
We ended up comparing over unset values as we had dnode_phys on one side
and dnode on another

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/zfs/zfs.c

index d6a321f086a11de75f5ac746d400121b29d315cb..bd49ddb9ea543cb608c1db08dbed46617e610a23 100644 (file)
@@ -2684,8 +2684,8 @@ dnode_get (dnode_end_t * mdn, grub_uint64_t objnum, grub_uint8_t type,
   blkid = objnum >> epbs;
   idx = objnum & ((1 << epbs) - 1);
 
-  if (data->dnode_buf != NULL && grub_memcmp (data->dnode_mdn, mdn,
-                                             sizeof (*mdn)) == 0
+  if (data->dnode_buf != NULL && grub_memcmp (data->dnode_mdn, &mdn->dn,
+                                             sizeof (mdn->dn)) == 0
       && objnum >= data->dnode_start && objnum < data->dnode_end)
     {
       grub_memmove (&(buf->dn), &(data->dnode_buf)[idx], DNODE_SIZE);