From: Alex Rousskov Date: Sat, 29 Jul 2023 17:44:59 +0000 (+0000) Subject: Bug 5290: pure virtual call in Ftp::Client constructor (#1429) X-Git-Tag: SQUID_6_2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1da3adbdd88d3c6663092c4dbd01c0ef542b1d9;p=thirdparty%2Fsquid.git Bug 5290: pure virtual call in Ftp::Client constructor (#1429) FATAL: Dying from an exception handling failure; exception: [no active exception] Converting `this` to CbcPointer in a constructor of an abstract class like Ftp::Client does not work because our virtual toCbdata() method remains pure until the final/child class constructor runs. Conceptually, the bug was probably introduced in 2013 commit 434a79b, when FTP class hierarchy grew, making Ftp::Client an abstract class, but the trigger was recent commit 337b9aa that removed CBDATA_CLASS() from Ftp::Client class declaration. We discovered, described, and addressed several such bugs in that commit, but we missed this case. --- diff --git a/src/clients/FtpClient.h b/src/clients/FtpClient.h index cbe0e58538..0db3b2da04 100644 --- a/src/clients/FtpClient.h +++ b/src/clients/FtpClient.h @@ -109,6 +109,8 @@ public: /// FTP client functionality shared among FTP Gateway and Relay clients. class Client: public ::Client { + CBDATA_INTERMEDIATE(); + public: explicit Client(FwdState *fwdState); ~Client() override;