Skip to content
Snippets Groups Projects
Commit 0af6a224 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee Committed by Guillaume Roguez
Browse files

call: Prevent a dbus signal race condition

If a call was deleted before the 'incomingCall' signal
arrived, LRC would crash on a nullptr dereference.

Refs #72322

(cherry picked from commit 51f01b14)
parent 29828468
Branches
Tags
No related merge requests found
...@@ -438,7 +438,13 @@ Call* CallModel::dialingCall(const QString& peerName, Account* account) ...@@ -438,7 +438,13 @@ Call* CallModel::dialingCall(const QString& peerName, Account* account)
Call* CallModelPrivate::addIncomingCall(const QString& callId) Call* CallModelPrivate::addIncomingCall(const QString& callId)
{ {
qDebug() << "New incoming call:" << callId; qDebug() << "New incoming call:" << callId;
Call* call = addCall2(CallPrivate::buildIncomingCall(callId)); Call* call = CallPrivate::buildIncomingCall(callId);
//The call can already have been invalidated by the daemon, then do nothing
if (!call)
return nullptr;
call = addCall2(call);
//The call can already have been invalidated by the daemon, then do nothing //The call can already have been invalidated by the daemon, then do nothing
if (!call) if (!call)
......
...@@ -237,6 +237,7 @@ ...@@ -237,6 +237,7 @@
</method> </method>
<method name="sendTextMessage" tp:name-for-bindings="sendTextMessage"> <method name="sendTextMessage" tp:name-for-bindings="sendTextMessage">
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/>
<arg type="s" name="accountID" direction="in"> <arg type="s" name="accountID" direction="in">
</arg> </arg>
<arg type="s" name="to" direction="in"> <arg type="s" name="to" direction="in">
...@@ -702,6 +703,7 @@ ...@@ -702,6 +703,7 @@
</method> </method>
<method name="getPinnedCertificates" tp:name-for-bindings="getPinnedCertificates"> <method name="getPinnedCertificates" tp:name-for-bindings="getPinnedCertificates">
<tp:added version="2.2.0"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="VectorString"/> <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="VectorString"/>
<arg type="as" name="certIds" direction="out"> <arg type="as" name="certIds" direction="out">
<tp:docstring> <tp:docstring>
...@@ -711,6 +713,7 @@ ...@@ -711,6 +713,7 @@
</method> </method>
<method name="pinCertificate" tp:name-for-bindings="pinCertificate"> <method name="pinCertificate" tp:name-for-bindings="pinCertificate">
<tp:added version="2.2.0"/>
<arg type="ay" name="certificateRaw" direction="in"> <arg type="ay" name="certificateRaw" direction="in">
<tp:docstring> <tp:docstring>
<p>A raw certificate (PEM or DER encoded) to be pinned.</p> <p>A raw certificate (PEM or DER encoded) to be pinned.</p>
...@@ -730,6 +733,7 @@ ...@@ -730,6 +733,7 @@
</method> </method>
<method name="unpinCertificate" tp:name-for-bindings="unpinCertificate"> <method name="unpinCertificate" tp:name-for-bindings="unpinCertificate">
<tp:added version="2.2.0"/>
<arg type="s" name="certId" direction="in"> <arg type="s" name="certId" direction="in">
<tp:docstring> <tp:docstring>
<p>A certificate ID to unpin.</p> <p>A certificate ID to unpin.</p>
...@@ -743,6 +747,7 @@ ...@@ -743,6 +747,7 @@
</method> </method>
<method name="pinCertificatePath" tp:name-for-bindings="pinCertificatePath"> <method name="pinCertificatePath" tp:name-for-bindings="pinCertificatePath">
<tp:added version="2.2.0"/>
<arg type="s" name="certPath" direction="in"> <arg type="s" name="certPath" direction="in">
<tp:docstring> <tp:docstring>
<p>A certificate path to be pinned (assumed non-local).</p> <p>A certificate path to be pinned (assumed non-local).</p>
...@@ -751,6 +756,7 @@ ...@@ -751,6 +756,7 @@
</method> </method>
<method name="unpinCertificatePath" tp:name-for-bindings="unpinCertificatePath"> <method name="unpinCertificatePath" tp:name-for-bindings="unpinCertificatePath">
<tp:added version="2.2.0"/>
<arg type="s" name="certPath" direction="in"> <arg type="s" name="certPath" direction="in">
<tp:docstring> <tp:docstring>
<p>Certificates path.</p> <p>Certificates path.</p>
...@@ -764,6 +770,7 @@ ...@@ -764,6 +770,7 @@
</method> </method>
<method name="pinRemoteCertificate" tp:name-for-bindings="pinRemoteCertificate"> <method name="pinRemoteCertificate" tp:name-for-bindings="pinRemoteCertificate">
<tp:added version="2.2.0"/>
<arg type="s" name="accountId" direction="in"> <arg type="s" name="accountId" direction="in">
<tp:docstring> <tp:docstring>
<p>An account ID</p> <p>An account ID</p>
...@@ -782,6 +789,7 @@ ...@@ -782,6 +789,7 @@
</method> </method>
<method name="setCertificateStatus" tp:name-for-bindings="setCertificateStatus"> <method name="setCertificateStatus" tp:name-for-bindings="setCertificateStatus">
<tp:added version="2.2.0"/>
<arg type="s" name="accountId" direction="in"> <arg type="s" name="accountId" direction="in">
<tp:docstring> <tp:docstring>
<p>An account ID</p> <p>An account ID</p>
...@@ -808,6 +816,7 @@ ...@@ -808,6 +816,7 @@
</method> </method>
<method name="getCertificatesByStatus" tp:name-for-bindings="getCertificatesByStatus"> <method name="getCertificatesByStatus" tp:name-for-bindings="getCertificatesByStatus">
<tp:added version="2.2.0"/>
<arg type="s" name="accountId" direction="in"> <arg type="s" name="accountId" direction="in">
<tp:docstring> <tp:docstring>
<p>An account ID</p> <p>An account ID</p>
...@@ -829,6 +838,7 @@ ...@@ -829,6 +838,7 @@
</method> </method>
<signal name="certificateStateChanged" tp:name-for-bindings="certificateStateChanged"> <signal name="certificateStateChanged" tp:name-for-bindings="certificateStateChanged">
<tp:added version="2.2.0"/>
<tp:docstring> <tp:docstring>
Notify clients that a certificate status have changed. Notify clients that a certificate status have changed.
</tp:docstring> </tp:docstring>
...@@ -841,6 +851,7 @@ ...@@ -841,6 +851,7 @@
</signal> </signal>
<signal name="certificatePinned" tp:name-for-bindings="certificatePinned"> <signal name="certificatePinned" tp:name-for-bindings="certificatePinned">
<tp:added version="2.2.0"/>
<tp:docstring> <tp:docstring>
Notify clients that a certificate have been added to the store. Notify clients that a certificate have been added to the store.
</tp:docstring> </tp:docstring>
...@@ -849,6 +860,7 @@ ...@@ -849,6 +860,7 @@
</signal> </signal>
<signal name="certificatePathPinned" tp:name-for-bindings="certificatePathPinned"> <signal name="certificatePathPinned" tp:name-for-bindings="certificatePathPinned">
<tp:added version="2.2.0"/>
<tp:docstring> <tp:docstring>
Notify clients that a certificate path have been added to the store. Notify clients that a certificate path have been added to the store.
</tp:docstring> </tp:docstring>
...@@ -863,7 +875,9 @@ ...@@ -863,7 +875,9 @@
</tp:docstring> </tp:docstring>
</arg> </arg>
</signal> </signal>
<signal name="certificateExpired" tp:name-for-bindings="certificateExpired"> <signal name="certificateExpired" tp:name-for-bindings="certificateExpired">
<tp:added version="2.2.0"/>
<tp:docstring> <tp:docstring>
Notify clients that a certificate expired. Notify clients that a certificate expired.
</tp:docstring> </tp:docstring>
...@@ -875,6 +889,7 @@ ...@@ -875,6 +889,7 @@
</signal> </signal>
<method name="getTrustRequests" tp:name-for-bindings="getTrustRequests"> <method name="getTrustRequests" tp:name-for-bindings="getTrustRequests">
<tp:added version="2.2.0"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/> <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/>
<arg type="s" name="accountID" direction="in"> <arg type="s" name="accountID" direction="in">
</arg> </arg>
...@@ -886,6 +901,7 @@ ...@@ -886,6 +901,7 @@
</method> </method>
<method name="acceptTrustRequest" tp:name-for-bindings="acceptTrustRequest"> <method name="acceptTrustRequest" tp:name-for-bindings="acceptTrustRequest">
<tp:added version="2.2.0"/>
<arg type="s" name="accountID" direction="in"> <arg type="s" name="accountID" direction="in">
</arg> </arg>
<arg type="s" name="from" direction="in"> <arg type="s" name="from" direction="in">
...@@ -896,7 +912,9 @@ ...@@ -896,7 +912,9 @@
</tp:docstring> </tp:docstring>
</arg> </arg>
</method> </method>
<method name="discardTrustRequest" tp:name-for-bindings="discardTrustRequest"> <method name="discardTrustRequest" tp:name-for-bindings="discardTrustRequest">
<tp:added version="2.2.0"/>
<arg type="s" name="accountID" direction="in"> <arg type="s" name="accountID" direction="in">
</arg> </arg>
<arg type="s" name="from" direction="in"> <arg type="s" name="from" direction="in">
...@@ -909,6 +927,7 @@ ...@@ -909,6 +927,7 @@
</method> </method>
<signal name="incomingTrustRequest" tp:name-for-bindings="incomingTrustRequest"> <signal name="incomingTrustRequest" tp:name-for-bindings="incomingTrustRequest">
<tp:added version="2.2.0"/>
<tp:docstring> <tp:docstring>
Notify clients that a new contact request has been received. Notify clients that a new contact request has been received.
</tp:docstring> </tp:docstring>
...@@ -921,6 +940,7 @@ ...@@ -921,6 +940,7 @@
</signal> </signal>
<method name="sendTrustRequest" tp:name-for-bindings="sendTrustRequest"> <method name="sendTrustRequest" tp:name-for-bindings="sendTrustRequest">
<tp:added version="2.2.0"/>
<arg type="s" name="accountID" direction="in"> <arg type="s" name="accountID" direction="in">
</arg> </arg>
<arg type="s" name="to" direction="in"> <arg type="s" name="to" direction="in">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment