From: Jamie Magee Date: Mon, 4 May 2026 16:00:55 +0000 (-0700) Subject: libfdisk: gpt: drop pointless unsigned >= 0 check X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a6ef2d43462485f494bd8e93fdcada41a0e4033f;p=thirdparty%2Futil-linux.git libfdisk: gpt: drop pointless unsigned >= 0 check GPT_ATTRBIT_REQ is 0 and val is uint16_t, so 'val >= GPT_ATTRBIT_REQ' is always true. CodeQL flagged it; keep only the upper bound. --- diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 2511361f6..ee6e206c3 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -1878,8 +1878,7 @@ static int gpt_entry_attrs_from_string( && val < GPT_ATTRBIT_GUID_FIRST + GPT_ATTRBIT_GUID_COUNT) { bit = val; p = num_end; - } else if (!is_guid && val >= GPT_ATTRBIT_REQ - && val <= GPT_ATTRBIT_LEGACY) { + } else if (!is_guid && val <= GPT_ATTRBIT_LEGACY) { bit = val; p = num_end; } else