From: Mark Murawki Date: Mon, 18 Jul 2011 12:56:49 +0000 (+0000) Subject: Merged revisions 328608 via svnmerge from X-Git-Tag: 10.0.0-beta1~3^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4b8e21079b88f124184b765c2a46568d152708b;p=thirdparty%2Fasterisk.git Merged revisions 328608 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328608 | markm | 2011-07-18 08:35:57 -0400 (Mon, 18 Jul 2011) | 9 lines If the sip private structure is null, sip_setoption() will defref the null pointer and crash. Ideally, sip_setoption shouldn't be called if there is a lack of a sip private structure. But this will fix a crash. (closes issue ASTERISK-17909) Reported by: Mark Murawski Tested by: Mark Murawski ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.10@328611 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 603d869537..74d328694e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4266,6 +4266,11 @@ static int sip_setoption(struct ast_channel *chan, int option, void *data, int d int res = -1; struct sip_pvt *p = chan->tech_pvt; + if (!p) { + ast_log(LOG_ERROR, "Attempt to Ref a null pointer. sip private structure is gone!\n"); + return -1; + } + sip_pvt_lock(p); switch (option) {