Skip to content

Commit

Permalink
bsock: stop timer before return from function
Browse files Browse the repository at this point in the history
 Fixes #1123: Director can crash during TwoWay Authentication
  • Loading branch information
franku committed Oct 25, 2019
1 parent c4c8d47 commit 5f718e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/lib/bsock.cc
Expand Up @@ -396,7 +396,10 @@ bool BareosSocket::TwoWayAuthenticate(JobControlRecord* jcr,

btimer_t* tid = StartBsockTimer(this, AUTH_TIMEOUT);

if (ConnectionReceivedTerminateSignal()) { return false; }
if (ConnectionReceivedTerminateSignal()) {
if (tid) { StopBsockTimer(tid); }
return false;
}

auth_success = cram_md5_handshake.DoHandshake(initiated_by_remote);
if (!auth_success) {
Expand Down

0 comments on commit 5f718e1

Please sign in to comment.