[svn-commits] kpfleming: branch 1.6.0 r108205 - in /branches/1.6.0: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 12 15:29:51 CDT 2008


Author: kpfleming
Date: Wed Mar 12 15:29:50 2008
New Revision: 108205

URL: http://svn.digium.com/view/asterisk?view=rev&rev=108205
Log:
Merged revisions 108191 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r108191 | kpfleming | 2008-03-12 15:27:01 -0500 (Wed, 12 Mar 2008) | 14 lines

Merged revisions 108086 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r108086 | kpfleming | 2008-03-12 14:16:07 -0500 (Wed, 12 Mar 2008) | 6 lines

if we receive an INVITE with a Content-Length that is not a valid number, or is zero, then don't process the rest of the message body looking for an SDP

closes issue #11475
Reported by: andrebarbosa


........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_sip.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=108205&r1=108204&r2=108205
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Wed Mar 12 15:29:50 2008
@@ -6146,12 +6146,27 @@
 static int find_sdp(struct sip_request *req)
 {
 	const char *content_type;
+	const char *content_length;
 	const char *search;
 	char *boundary;
 	unsigned int x;
 	int boundaryisquoted = FALSE;
 	int found_application_sdp = FALSE;
 	int found_end_of_headers = FALSE;
+
+	content_length = get_header(req, "Content-Length");
+
+	if (!ast_strlen_zero(content_length)) {
+		if (sscanf(content_length, "%ud", &x) != 1) {
+			ast_log(LOG_WARNING, "Invalid Content-Length: %s\n", content_length);
+			return 0;
+		}
+
+		/* Content-Length of zero means there can't possibly be an
+		   SDP here, even if the Content-Type says there is */
+		if (x == 0)
+			return 0;
+	}
 
 	content_type = get_header(req, "Content-Type");
 




More information about the svn-commits mailing list