MT#59962 AmB2BSession: acceptPendingInviteB2B() check body

Check if body found before actually use it.

Fixes:

*** CID 583401:         Null pointer dereferences  (NULL_RETURNS)
/core/AmB2BSession.cpp: 379             in AmB2BSession::acceptPendingInviteB2B(const AmSipRequest &)()
373           remote_port = remote_sdp_media.port;
374         }
375       }
376
377       if (remote_port > 0) {
378         ILOG_DLG(L_DBG, "Using remotely seen SDP port for faking this reply: '%d'\n", remote_port);
>>>     CID 583401:         Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" "sdp" when calling "addFakeSDPbasedOnPort".
379         addFakeSDPbasedOnPort(sdp, n_reply.body, remote_port);
380       }
381       else {
382         createFakeReply(sdp, n_reply.body);
383       }
384

Change-Id: I1aef23c68735b091ada8bca597cecea5987b46b0
mr13.5
Donat Zenichev 1 year ago
parent 34e6b76355
commit d53e757af8

@ -365,6 +365,11 @@ void AmB2BSession::acceptPendingInvite(AmSipRequest *invite, const AmMimeBody *s
void AmB2BSession::acceptPendingInviteB2B(const AmSipRequest& invite)
{
const AmMimeBody *sdp = invite.body.hasContentType(SIP_APPLICATION_SDP);
if (!sdp) {
ILOG_DLG(L_WARN, "No application/sdp content found to create fake 200OK.\n");
return;
}
AmSipReply n_reply;
/* local sdp, which was already learned before */

Loading…
Cancel
Save