From 52f35f1eccaf94f47b3cb138b53eccb0e6ed9f38 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 6 Apr 2017 13:39:44 +0200 Subject: [PATCH] libfdisk: (gpt) fix ents zeroize The gpt->ents is "unsigned char" buffer now. We need to use bytes, no number of entries... Signed-off-by: Karel Zak --- libfdisk/src/gpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 092954f11c..cf00d676e7 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -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; } -- 2.47.3