]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Fix overflow checking in archive_entry_sparse_add_entry() 33/head
authorXi Wang <xi.wang@gmail.com>
Sun, 20 Jan 2013 23:17:20 +0000 (18:17 -0500)
committerXi Wang <xi@mit.edu>
Sat, 16 Mar 2013 03:17:20 +0000 (23:17 -0400)
commitbc533e5afff62f35c69103c0bb84b3640bf17f34
tree98c507e90983869751830987a2d21bb62b36ce37
parentd767d7904781794442938df6b0dd29c8da325e03
Fix overflow checking in archive_entry_sparse_add_entry()

gcc will optimize the overflow check x + y < 0 (assuming x, y >= 0)
into false, since signed integer overflow is undefined behavior in C.
Use a safe precondition check instead.
libarchive/archive_entry_sparse.c