]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
[7zip] Another shift UB caused by integer promotion 3014/head
authorTim Kientzle <kientzle@acm.org>
Fri, 8 May 2026 05:04:20 +0000 (22:04 -0700)
committerTim Kientzle <kientzle@acm.org>
Fri, 8 May 2026 05:04:20 +0000 (22:04 -0700)
libarchive/archive_read_support_format_7zip.c

index b493df1e6d1eb7e47c03c3ec3d4ed197c5493dca..325e0e9ddb771316489a01ea2a41fa8dc5fefea5 100644 (file)
@@ -4311,7 +4311,7 @@ sparc_Convert(struct _7zip *zip, uint8_t *buf, size_t size)
        size &= ~(size_t)3;
 
        for (i = 0; i < size; i += 4) {
-               instr = (uint32_t)(buf[i] << 24)
+               instr = ((uint32_t)buf[i] << 24)
                        | ((uint32_t)buf[i+1] << 16)
                        | ((uint32_t)buf[i+2] << 8)
                        | (uint32_t)buf[i+3];