[svn-commits] schmidts: branch 1.8 r348048 - /branches/1.8/channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Dec 13 09:16:59 CST 2011


Author: schmidts
Date: Tue Dec 13 09:16:50 2011
New Revision: 348048

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=348048
Log:
Fix possible misshandling of an incoming SIP response as a peer poke response.
Also make sure peer has even qualify enabled when handle a peer poke response.

(closes issue ASTERISK-18940)
Reported by: Vitaliy
Tested by: Vitaliy and UnixDev

Review: https://reviewboard.asterisk.org/r/1620
Reviewed by: David Vossel


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=348048&r1=348047&r2=348048
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Tue Dec 13 09:16:50 2011
@@ -20572,8 +20572,14 @@
 	 * -1 means did not respond, 0 means unknown,
 	 * 1..maxms is a valid response, >maxms means late response.
 	 */
-	if (pingtime < 1)	/* zero = unknown, so round up to 1 */
+	if (pingtime < 1) {	/* zero = unknown, so round up to 1 */
 		pingtime = 1;
+	}
+
+	if (!peer->maxms) { /* this should never happens */
+		pvt_set_needdestroy(p, "got OPTIONS response but qualify is not enabled");
+		return;
+	}
 
 	/* Now determine new state and whether it has changed.
 	 * Use some helper variables to simplify the writing
@@ -20799,7 +20805,7 @@
 		return;
 	}
 
-	if (p->relatedpeer && p->method == SIP_OPTIONS) {
+	if (p->relatedpeer && sipmethod == SIP_OPTIONS) {
 		/* We don't really care what the response is, just that it replied back.
 		   Well, as long as it's not a 100 response...  since we might
 		   need to hang around for something more "definitive" */




More information about the svn-commits mailing list