forked from qt-creator/qt-creator
Fixed segfault in SshKeyExchange due to using object after deletion
m_dhKey pointer has been used for debug output just after resetting it to nullptr. Change-Id: I1aa4e16b19c7a16738b7734423277cf7eecd8054 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -154,9 +154,9 @@ void SshKeyExchange::sendNewKeysPacket(const SshIncomingPacket &dhReply,
|
|||||||
DH_KA_Operation dhOp(*m_dhKey);
|
DH_KA_Operation dhOp(*m_dhKey);
|
||||||
SecureVector<byte> encodedF = BigInt::encode(reply.f);
|
SecureVector<byte> encodedF = BigInt::encode(reply.f);
|
||||||
encodedK = dhOp.agree(encodedF, encodedF.size());
|
encodedK = dhOp.agree(encodedF, encodedF.size());
|
||||||
m_dhKey.reset(nullptr);
|
|
||||||
printData("y", AbstractSshPacket::encodeMpInt(m_dhKey->get_y()));
|
printData("y", AbstractSshPacket::encodeMpInt(m_dhKey->get_y()));
|
||||||
printData("f", AbstractSshPacket::encodeMpInt(reply.f));
|
printData("f", AbstractSshPacket::encodeMpInt(reply.f));
|
||||||
|
m_dhKey.reset(nullptr);
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(m_ecdhKey);
|
Q_ASSERT(m_ecdhKey);
|
||||||
concatenatedData // Q_C.
|
concatenatedData // Q_C.
|
||||||
|
|||||||
Reference in New Issue
Block a user