diff --git a/src/ssh/Input.cxx b/src/ssh/Input.cxx index 2c28b9f..b424528 100644 --- a/src/ssh/Input.cxx +++ b/src/ssh/Input.cxx @@ -183,11 +183,11 @@ Input::ReadUnencryptedPacket() inline std::span 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