From 97c273bdbe555f8d4e64c1e302dbbf71e59711fc Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Wed, 10 Jan 2024 14:21:38 +0100 Subject: [PATCH] Fix PeerConnection::checkFingerprint --- src/impl/peerconnection.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/impl/peerconnection.cpp b/src/impl/peerconnection.cpp index 943da6752..a20446d1f 100644 --- a/src/impl/peerconnection.cpp +++ b/src/impl/peerconnection.cpp @@ -423,8 +423,11 @@ void PeerConnection::rollbackLocalDescription() { bool PeerConnection::checkFingerprint(const std::string &fingerprint) const { std::lock_guard lock(mRemoteDescriptionMutex); - auto expectedFingerprint = mRemoteDescription && mRemoteDescription->fingerprint() ? mRemoteDescription->fingerprint()->value : ""; - if (expectedFingerprint == fingerprint) { + if (!mRemoteDescription || !mRemoteDescription->fingerprint()) + return false; + + auto expectedFingerprint = mRemoteDescription->fingerprint()->value; + if (expectedFingerprint == fingerprint) { PLOG_VERBOSE << "Valid fingerprint \"" << fingerprint << "\""; return true; }