Skip to content

Commit

Permalink
Ftp::Gateway may segfault in level-3 double-complete debugs() (#1923)
Browse files Browse the repository at this point in the history
Ftp::Gateway::completeForwarding() must check data.conn pointer before
dereferencing it. Long-term, we should improve Comm::ConnectionPointer
printing to safely report Connection::id (where available). This minimal
fix just mimics existing Ftp::Relay::abortOnData() solution.
  • Loading branch information
eduard-bagdasaryan authored and squid-anubis committed Oct 29, 2024
1 parent 240efcb commit 797039b
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 @@ -2639,7 +2639,7 @@ Ftp::Gateway::completeForwarding()
{
if (fwd == nullptr || flags.completed_forwarding) {
debugs(9, 3, "avoid double-complete on FD " <<
(ctrl.conn ? ctrl.conn->fd : -1) << ", Data FD " << data.conn->fd <<
(ctrl.conn ? ctrl.conn->fd : -1) << ", Data FD " << (data.conn ? data.conn->fd : -1) <<
", this " << this << ", fwd " << fwd);
return;
}
Expand Down

0 comments on commit 797039b

Please sign in to comment.