Skip to content
Snippets Groups Projects
Commit da39835b authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2
Browse files

prevent a crash if im::sendSipMessage fails

im::sendSipMessage() may throw an exception but caller
doesn't take that into account. This may cause undefined behaviour,
like a crash on some platforms.

This patch encapsulates the im::sendSipMessage() call into a try/catch.

Change-Id: Ie07105f02d64a37a009e510bb674716ec20212c9
Tuleap: #1172
parent d2f72d61
Branches
Tags
No related merge requests found
...@@ -671,7 +671,9 @@ SIPCall::sendTextMessage(const std::map<std::string, std::string>& messages, ...@@ -671,7 +671,9 @@ SIPCall::sendTextMessage(const std::map<std::string, std::string>& messages,
c->sendTextMessage(messages, from); c->sendTextMessage(messages, from);
} else { } else {
if (inv) { if (inv) {
try {
im::sendSipMessage(inv.get(), messages); im::sendSipMessage(inv.get(), messages);
} catch (...) {}
} else { } else {
pendingOutMessages_.emplace_back(messages, from); pendingOutMessages_.emplace_back(messages, from);
RING_ERR("[call:%s] sendTextMessage: no invite session for this call", getCallId().c_str()); RING_ERR("[call:%s] sendTextMessage: no invite session for this call", getCallId().c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment