]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/crc32c: fix assert()
authorKarel Zak <kzak@redhat.com>
Tue, 18 Apr 2023 11:54:17 +0000 (13:54 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Apr 2023 11:54:41 +0000 (13:54 +0200)
Addresses: https://github.com/util-linux/util-linux/pull/2165
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/crc32c.c

index 05b14281bbeb6683e4a5b403d05d2f9e8dd1421c..5776727a251468737f5565a87b3322041620231d 100644 (file)
@@ -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++) {