[Asterisk-code-review] res pjsip session: segfault on already disconnected session (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Fri Aug 12 15:40:51 CDT 2016


Hello Anonymous Coward #1000019,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/3514

to look at the new patch set (#3).

Change subject: res_pjsip_session: segfault on already disconnected session
......................................................................

res_pjsip_session: segfault on already disconnected session

The function create_local_sdp tries to allocate a memory
on an already disconnected session.
The function handle_incoming_sdp calls
negotiate_incoming_sdp_stream on an already disconnected session
which ultimately leads to segfault in libpjmedia.

If the session in the disconnected state then the session memory
pools were already freed, so we get segfault.

This was happened on TLS sessions.
Before segfault there were pjproject WARNING/ERROR about
Failed sending because of Broken pipe.

This patch adds check if the session state is not disconnected
and also checks if the memory pool is not NULL.

ASTERISK-26291 #close

Change-Id: I4d28b1fb3b91f0492a911d110049d670fdc3c8d7
---
M res/res_pjsip_session.c
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/14/3514/3
-- 
To view, visit https://gerrit.asterisk.org/3514
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4d28b1fb3b91f0492a911d110049d670fdc3c8d7
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019



More information about the asterisk-code-review mailing list