Skip to content

Commit

Permalink
ssh/Input: access error only while holding the mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jul 3, 2024
1 parent 0b1a12e commit d50562a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ssh/Input.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ Input::ReadUnencryptedPacket()
inline std::span<const std::byte>
Input::ReadDecryptedPacket()
{
const std::scoped_lock lock{mutex};

if (error)
std::rethrow_exception(error);

const std::scoped_lock lock{mutex};

if (decrypted_list.empty()) {
/* if there was a NEWKEYS packet, it must have been
handled by now and SetCipher() must have been
Expand Down

0 comments on commit d50562a

Please sign in to comment.