[asterisk-commits] markm: branch 1.8 r328608 - /branches/1.8/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 18 07:36:01 CDT 2011


Author: markm
Date: Mon Jul 18 07:35:57 2011
New Revision: 328608

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=328608
Log:
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


Modified:
    branches/1.8/channels/chan_sip.c

Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=328608&r1=328607&r2=328608
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Mon Jul 18 07:35:57 2011
@@ -4231,6 +4231,11 @@
 	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) {




More information about the asterisk-commits mailing list