mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +00:00
Ensure that a null vmexten does not cause a segfault
When sip_send_mwi_to_peer was modified recently to avoid deadlocks, vmexten was not expected to be null. This change handles that situation to avoid a segfault. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@345063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -25280,11 +25280,13 @@ static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only)
|
|||||||
/* Called with peerl lock, but releases it */
|
/* Called with peerl lock, but releases it */
|
||||||
struct sip_pvt *p;
|
struct sip_pvt *p;
|
||||||
int newmsgs = 0, oldmsgs = 0;
|
int newmsgs = 0, oldmsgs = 0;
|
||||||
const char *vmexten;
|
const char *vmexten = NULL;
|
||||||
|
|
||||||
ao2_lock(peer);
|
ao2_lock(peer);
|
||||||
|
|
||||||
|
if (peer->vmexten) {
|
||||||
vmexten = ast_strdupa(peer->vmexten);
|
vmexten = ast_strdupa(peer->vmexten);
|
||||||
|
}
|
||||||
|
|
||||||
if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt) {
|
if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt) {
|
||||||
ao2_unlock(peer);
|
ao2_unlock(peer);
|
||||||
|
|||||||
Reference in New Issue
Block a user