src: introduce upx::max and friends; updates for clang-19 git snapshot

This commit is contained in:
Markus F.X.J. Oberhumer
2024-05-15 14:06:05 +02:00
parent 9e0f16a629
commit 40b7e24fcc
21 changed files with 254 additions and 159 deletions
+1 -3
View File
@@ -599,8 +599,6 @@ int PackUnix::find_overlay_offset(MemBuffer const &buf)
// See notes there.
**************************************************************************/
static unsigned umax(unsigned a, unsigned b) {return (a < b) ? b : a;}
void PackUnix::unpack(OutputFile *fo)
{
b_info bhdr;
@@ -671,7 +669,7 @@ void PackUnix::unpack(OutputFile *fo)
// first flag bits of NRV_d32, the 5-byte info of LZMA, etc.
// Fuzzers may try sz_cpr shorter than possible.
// Use some OVERHEAD for safety.
i = blocksize + OVERHEAD - umax(12, sz_cpr);
i = blocksize + OVERHEAD - upx::umax(12u, sz_cpr);
if (i < 0)
throwCantUnpack("corrupt b_info");
fi->readx(buf+i, sz_cpr);