]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not leak memory when reading FTP CWD responses (#2445) master
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 20 Jun 2026 16:15:17 +0000 (16:15 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 20 Jun 2026 16:15:23 +0000 (16:15 +0000)
The bug affected a subset of HTTP transactions with `ftp://` URLs.
It was introduced in 2009 commit 0477a072.

src/clients/FtpGateway.cc

index e9031ce41a22d7e2809e545a32d5aa15cfa8f1a1..664387e8f620769b2d9c67baaee6e393d1bd4e83 100644 (file)
@@ -1497,7 +1497,7 @@ ftpReadCwd(Ftp::Gateway * ftpState)
             ftpState->cwd_message.append('\n');
             ftpState->cwd_message.append(w->key);
         }
-        ftpState->ctrl.message = nullptr;
+        wordlistDestroy(&ftpState->ctrl.message);
 
         /* Continue to traverse the path */
         ftpTraverseDirectory(ftpState);