From ce2d993bc667f634a8a98503a99249fcc21a9af2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 8 Feb 2023 16:21:32 +0100 Subject: [PATCH] libfdisk: (gpt) remove unnecessary code The function gpt_sizeof_entries() already checks for limits. Fixes: https://github.com/util-linux/util-linux/issues/2057 Signed-off-by: Karel Zak --- libfdisk/src/gpt.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 8f9a0a1189..d7b3e1c708 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -1018,11 +1018,6 @@ static unsigned char *gpt_read_entries(struct fdisk_context *cxt, if (gpt_sizeof_entries(header, &sz)) return NULL; - if (sz > (size_t) SSIZE_MAX) { - DBG(GPT, ul_debug("entries array too large to read()")); - return NULL; - } - ret = calloc(1, sz); if (!ret) return NULL; -- 2.47.2