[asterisk-commits] schmidts: trunk r348061 - /trunk/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Dec 13 09:22:58 CST 2011
Author: schmidts
Date: Tue Dec 13 09:22:48 2011
New Revision: 348061
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=348061
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
........
Merged revisions 348048 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 348056 from http://svn.asterisk.org/svn/asterisk/branches/10
Modified:
trunk/channels/chan_sip.c
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=348061&r1=348060&r2=348061
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Dec 13 09:22:48 2011
@@ -21140,8 +21140,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
@@ -21415,7 +21421,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 asterisk-commits
mailing list