]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (gpt) fix PMBR read overflow
authorKarel Zak <kzak@redhat.com>
Mon, 11 Jul 2022 10:49:21 +0000 (12:49 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Jul 2022 10:49:21 +0000 (12:49 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c

index c132739b2bfa43a9aec1e1d888b5e8d9efcd4b1a..1fed8641f467968513da48b34154f21dc14ec815 100644 (file)
@@ -2129,7 +2129,7 @@ static int gpt_write_pmbr(struct fdisk_context *cxt)
                goto do_write;
 
        rc = gpt_read(cxt, GPT_PMBR_LBA * cxt->sector_size,
-                     current, cxt->sector_size);
+                     current, sizeof(*current));
        if (!rc)
                rc = memcmp(pmbr, current, sizeof(*current));