From 39bd31eea3eda72b7a13d45b4deb8b5c93d1760b Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Fri, 11 Apr 2025 08:25:18 +0200 Subject: [PATCH] MT#59962 CallLeg: use WARN() instead of ILOG_DLG() We are passing here null pointer (so `this->dlg->getCallid()`) which isn't good. Just use a default `WARN()` instead. Fixes: *** CID 549008: Null pointer dereferences (FORWARD_NULL) /apps/sbc/CallLeg.cpp: 193 in CallLeg::CallLeg(const CallLeg*, AmSipDialog *, AmSipSubscription *)() 187 188 // enable OA for the purpose of hold request detection 189 if (dlg) { 190 dlg->setOAEnabled(true); 191 dlg->setOAForceSDP(false); 192 } >>> CID 549008: Null pointer dereferences (FORWARD_NULL) >>> Passing null pointer "this->dlg->getCallid()" to "c_str", which dereferences it. [Note: The source code implementation of the function has been overridden by a builtin model.] 193 else ILOG_DLG(L_WARN, "can't enable OA!\n"); 194 195 // code below taken from createCalleeSession 196 197 const AmSipDialog* caller_dlg = caller->dlg; 198 Change-Id: If1f62386c9a2d3f6df4a12a2b157802b8a0677fa --- apps/sbc/CallLeg.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/sbc/CallLeg.cpp b/apps/sbc/CallLeg.cpp index 37bd3ede..4960d147 100644 --- a/apps/sbc/CallLeg.cpp +++ b/apps/sbc/CallLeg.cpp @@ -189,8 +189,9 @@ CallLeg::CallLeg(const CallLeg* caller, AmSipDialog* p_dlg, AmSipSubscription* p if (dlg) { dlg->setOAEnabled(true); dlg->setOAForceSDP(false); + } else { + WARN("can't enable OA!\n"); } - else ILOG_DLG(L_WARN, "can't enable OA!\n"); // code below taken from createCalleeSession @@ -255,10 +256,11 @@ CallLeg::CallLeg(AmSipDialog* p_dlg, AmSipSubscription* p_subs) if (dlg) { dlg->setOAEnabled(true); dlg->setOAForceSDP(false); + } else { + WARN("can't enable OA!\n"); } - else ILOG_DLG(L_WARN, "can't enable OA!\n"); } - + CallLeg::~CallLeg() { // do necessary cleanup (might be needed if the call leg is destroyed other