From a82283b7a23e9a96f9fbef0934850cd92911f5cd Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sun, 22 Sep 2024 21:30:38 -0400 Subject: [PATCH] Add timeout to SSH Agent streams * Fixes #11128 --- src/sshagent/BinaryStream.cpp | 2 -- src/sshagent/BinaryStream.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sshagent/BinaryStream.cpp b/src/sshagent/BinaryStream.cpp index 3ba4c1a81..2ac93943c 100644 --- a/src/sshagent/BinaryStream.cpp +++ b/src/sshagent/BinaryStream.cpp @@ -21,14 +21,12 @@ BinaryStream::BinaryStream(QIODevice* device) : QObject(device) - , m_timeout(-1) , m_device(device) { } BinaryStream::BinaryStream(QByteArray* ba, QObject* parent) : QObject(parent) - , m_timeout(-1) { m_buffer.reset(new QBuffer(ba)); m_buffer->open(QIODevice::ReadWrite); diff --git a/src/sshagent/BinaryStream.h b/src/sshagent/BinaryStream.h index 0bc06e845..04c2a826b 100644 --- a/src/sshagent/BinaryStream.h +++ b/src/sshagent/BinaryStream.h @@ -55,7 +55,7 @@ protected: bool write(const char* ptr, qint64 len); private: - int m_timeout; + int m_timeout = 5000; QString m_error; QIODevice* m_device; QScopedPointer m_buffer;