[asterisk-commits] kmoore: trunk r401540 - in /trunk: ./ channels/chan_mgcp.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Oct 23 10:23:59 CDT 2013
Author: kmoore
Date: Wed Oct 23 10:23:58 2013
New Revision: 401540
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401540
Log:
chan_mgcp: Properly handle malformed media lines
This corrects a situation in which a media line was not parsed properly
and resulted in a crash.
(closes issue ASTERISK-21190)
Reported by: adomjan
Patches:
chan_mgcp.c-sscnaf_fix uploaded by adomjan (License 5448)
........
Merged revisions 401537 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 401538 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 401539 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/channels/chan_mgcp.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.
Modified: trunk/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=401540&r1=401539&r2=401540
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Wed Oct 23 10:23:58 2013
@@ -1971,7 +1971,7 @@
char *c;
char *a;
char host[258];
- int len;
+ int len = 0;
int portno;
struct ast_format_cap *peercap;
int peerNonCodecCapability;
@@ -2001,8 +2001,8 @@
ast_log(LOG_WARNING, "Unable to lookup host in c= line, '%s'\n", c);
return -1;
}
- if (sscanf(m, "audio %30d RTP/AVP %n", &portno, &len) != 1) {
- ast_log(LOG_WARNING, "Unable to determine port number for RTP in '%s'\n", m);
+ if (sscanf(m, "audio %30d RTP/AVP %n", &portno, &len) != 1 || !len) {
+ ast_log(LOG_WARNING, "Malformed media stream descriptor: %s\n", m);
return -1;
}
sin.sin_family = AF_INET;
More information about the asterisk-commits
mailing list