Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/peer_digest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<ssize_t>(pd->cd->mask_size)) {
Assure(pd->cd->mask_size >= fetch->mask_offset);
if (static_cast<size_t>(size) > pd->cd->mask_size - fetch->mask_offset) {
finishAndDeleteFetch(fetch, "peer digest mask data too large", true);
return -1;
}
Expand Down
Loading