From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Tue, 2 Jun 2026 20:53:07 +0000 (+0000) Subject: Fix -Wsign-compare on arm32 (#2432) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fauto;p=thirdparty%2Fsquid.git Fix -Wsign-compare on arm32 (#2432) Due to ssize_t differences on 32/64 bit platforms, changes to peerDigestSwapInMask in commit 556b91a8a7 cause signedness comparison errors. Refactor to be safe both on 32- and 64-bit platforms --- diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 3546208e72..8660242d0f 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -559,7 +559,8 @@ peerDigestSwapInMask(void *data, char *buf, ssize_t size) * we need to do the copy ourselves! */ Assure(size >= 0); - if (fetch->mask_offset + size > static_cast(pd->cd->mask_size)) { + Assure(pd->cd->mask_size >= fetch->mask_offset); + if (static_cast(size) > pd->cd->mask_size - fetch->mask_offset) { finishAndDeleteFetch(fetch, "peer digest mask data too large", true); return -1; }