]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Avoid left-shift overflow of signed integer
authorBrad King <brad.king@kitware.com>
Wed, 21 Oct 2015 16:02:21 +0000 (12:02 -0400)
committerBrad King <brad.king@kitware.com>
Mon, 26 Oct 2015 12:59:26 +0000 (08:59 -0400)
commit963983ab5b650d286ac09db660feb82f9d67257a
treee6dc8aa42fe929d8d39f987f30397868f39dbe1f
parente091ed9a17f513bd2d3883df0bcd5d4383e5f14a
Avoid left-shift overflow of signed integer

In libarchive/archive_write_set_format_zip.c there are two calls to
archive_le32enc whose second argument is of the form

 archive_entry_mode(zip->entry) << 16

However, the return type from archive_entry_mode may be a signed integer
so the shift may overflow.  Since the second argument of archive_le32enc
expects uint32_t anyway, simply cast to that prior to shifting.
libarchive/archive_write_set_format_zip.c