Skip to content

Commit

Permalink
Fix a possible integer overflow in Ftp::Gateway (squid-cache#1647)
Browse files Browse the repository at this point in the history
A static analysis tool has discovered that const int csize,
might have overflowed before being passed to writeReplyBody().
  • Loading branch information
brozs authored and squid-anubis committed Jan 30, 2024
1 parent 12638be commit c8f5d7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clients/FtpGateway.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ Ftp::Gateway::processReplyBody()
parseListing();
maybeReadVirginBody();
return;
} else if (const int csize = data.readBuf->contentSize()) {
} else if (const auto csize = data.readBuf->contentSize()) {
writeReplyBody(data.readBuf->content(), csize);
debugs(9, 5, "consuming " << csize << " bytes of readBuf");
data.readBuf->consume(csize);
Expand Down

0 comments on commit c8f5d7d

Please sign in to comment.