]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
cab reader: cast to int when subtracting unsigned integers
authorMartin Matuska <martin@matuska.de>
Wed, 7 Dec 2022 14:52:54 +0000 (15:52 +0100)
committerMartin Matuska <martin@matuska.de>
Wed, 7 Dec 2022 14:52:54 +0000 (15:52 +0100)
Found by: GitHub CodeQL

libarchive/archive_read_support_format_cab.c

index ea256cda895c09a0f8b0b10fcc29a13f6331328c..4d5029b1bd2eed361378a7410a68b241babfa1da 100644 (file)
@@ -1134,7 +1134,7 @@ cab_checksum_update(struct archive_read *a, size_t bytes)
        }
        if (sumbytes) {
                int odd = sumbytes & 3;
-               if (sumbytes - odd > 0)
+               if ((int)(sumbytes - odd) > 0)
                        cfdata->sum_calculated = cab_checksum_cfdata_4(
                            p, sumbytes - odd, cfdata->sum_calculated);
                if (odd)