]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (gpt) fix ents zeroize
authorKarel Zak <kzak@redhat.com>
Thu, 6 Apr 2017 11:39:44 +0000 (13:39 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Apr 2017 11:39:44 +0000 (13:39 +0200)
The gpt->ents is "unsigned char" buffer now. We need to use bytes, no
number of entries...

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c

index 092954f11c9158b3a7e6bcd573837e43f2b86e67..cf00d676e7dd491e710ae51439522f5ec801af9a 100644 (file)
@@ -2654,7 +2654,7 @@ int fdisk_gpt_set_npartitions(struct fdisk_context *cxt, uint32_t entries)
                        fdisk_warnx(cxt, _("Cannot allocate memory!"));
                        return -ENOMEM;
                }
-               memset(ents + old, 0, new_size - old_size);
+               memset(ents + old_size, 0, new_size - old_size);
                gpt->ents = ents;
        }