]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (gpt) remove unnecessary code
authorKarel Zak <kzak@redhat.com>
Wed, 8 Feb 2023 15:21:32 +0000 (16:21 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 8 Feb 2023 15:21:32 +0000 (16:21 +0100)
The function gpt_sizeof_entries() already checks for limits.

Fixes: https://github.com/util-linux/util-linux/issues/2057
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c

index 8f9a0a1189a040b32ca54c296e0e6e37dfc78a57..d7b3e1c70829eb96f76929c77d420888481249ed 100644 (file)
@@ -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;