From 5f03a197bd8c59dc23096b3cad9e4aab35bcc57b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 18 Apr 2023 13:54:17 +0200 Subject: [PATCH] lib/crc32c: fix assert() Addresses: https://github.com/util-linux/util-linux/pull/2165 Signed-off-by: Karel Zak --- lib/crc32c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crc32c.c b/lib/crc32c.c index 05b14281bb..5776727a25 100644 --- a/lib/crc32c.c +++ b/lib/crc32c.c @@ -107,7 +107,8 @@ ul_crc32c_exclude_offset(uint32_t crc, const unsigned char *buf, size_t size, size_t exclude_off, size_t exclude_len) { size_t i; - assert((exclude_off + exclude_len) < size); + + assert((exclude_off + exclude_len) <= size); crc = crc32c(crc, buf, exclude_off); for (i = 0; i < exclude_len; i++) { -- 2.47.2