diff options
author | markm <markm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-07-18 12:58:02 +0000 |
---|---|---|
committer | markm <markm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2011-07-18 12:58:02 +0000 |
commit | 36b69d0c2caf73f401c93024b19d0e8c3e465f8e (patch) | |
tree | 86360616e767d0e1f2ebd5a979bfac4cbb89b1cc | |
parent | 79206e605228129478a5707e801229c3d47ffd76 (diff) |
Merged revisions 328611 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10
................
r328611 | markm | 2011-07-18 08:56:49 -0400 (Mon, 18 Jul 2011) | 15 lines
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: http://svn.digium.com/svn/asterisk/trunk@328612 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 603d86953..74d328694 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) { |