From 155d87829358a75d60833fb43c3a55d65f49cf8b Mon Sep 17 00:00:00 2001
From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Date: Tue, 20 Jun 2017 22:42:46 -0400
Subject: [PATCH] manager: fix crash with invalid parameters

If Manager::outgoinCall() is called with an non-empty but invalid conf_id
the application will crash with the call is hangup.
Fix that by checking conference id validity and existance.

Change-Id: If53defb747eaa25d2f3fce773b159b13fe34ad52
---
 src/manager.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/manager.cpp b/src/manager.cpp
index ca7b2e8113..b7c94832d3 100644
--- a/src/manager.cpp
+++ b/src/manager.cpp
@@ -839,6 +839,11 @@ Manager::outgoingCall(const std::string& preferred_account_id,
                           const std::string& to,
                           const std::string& conf_id)
 {
+    if (not conf_id.empty() and not isConference(conf_id)) {
+        RING_ERR("outgoingCall() failed, invalid conference id");
+        return {};
+    }
+
     std::string current_call_id(getCurrentCallId());
     std::string to_cleaned = hookPreference.getNumberAddPrefix() + trim(to);
     std::shared_ptr<Call> call;
-- 
GitLab