]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix a possible integer overflow in Ftp::Gateway (#1647)
authorŠtěpán Brož <32738079+brozs@users.noreply.github.com>
Tue, 30 Jan 2024 21:35:37 +0000 (21:35 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 2 Feb 2024 19:29:50 +0000 (08:29 +1300)
A static analysis tool has discovered that const int csize,
might have overflowed before being passed to writeReplyBody().

src/clients/FtpGateway.cc

index 1a51aa6307ce6bac8fe321495383e9ede5109dcf..22abc0d84b382b6f12f890cc66d12ca822e13cc8 100644 (file)
@@ -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);