Skip to content

Commit

Permalink
Merge pull request #8071 from azat/Connection-sendCancel-SIGSEGV
Browse files Browse the repository at this point in the history
Avoid null dereference after "Unknown packet X from server"

(cherry picked from commit bef3a0d)
  • Loading branch information
alexey-milovidov authored and KochetovNicolai committed Dec 17, 2019
1 parent 2767862 commit fbb51a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbms/src/Client/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ void Connection::sendQuery(

void Connection::sendCancel()
{
/// If we already disconnected.
if (!out)
return;

//LOG_TRACE(log_wrapper.get(), "Sending cancel");

writeVarUInt(Protocol::Client::Cancel, *out);
Expand Down

0 comments on commit fbb51a5

Please sign in to comment.