]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 230773 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 23 Nov 2009 14:20:42 +0000 (14:20 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 23 Nov 2009 14:20:42 +0000 (14:20 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r230773 | kpfleming | 2009-11-23 08:15:48 -0600 (Mon, 23 Nov 2009) | 12 lines

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

  ........
    r230772 | kpfleming | 2009-11-23 08:13:56 -0600 (Mon, 23 Nov 2009) | 5 lines

    Ensure that SDP parsing does not ignore the last line of the SDP.

    (closes issue #16268)
    Reported by: sgimeno
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@230790 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 7674243c93f5377a750a95579ece8184a4c70f68..92caa054abe14e8e96031630d5a60d735d2e878a 100644 (file)
@@ -6361,7 +6361,7 @@ static const char *get_sdp_iterate(int *start, struct sip_request *req, const ch
 {
        int len = strlen(name);
 
-       while (*start < req->sdp_end) {
+       while (*start <= req->sdp_end) {
                const char *r = get_body_by_line(REQ_OFFSET_TO_STR(req, line[(*start)++]), name, len);
                if (r[0] != '\0')
                        return r;
@@ -6371,15 +6371,16 @@ static const char *get_sdp_iterate(int *start, struct sip_request *req, const ch
 }
 
 /*! \brief Fetches the next valid SDP line between the 'start' line
- * and the 'stop' line. Returns the type ('a', 'c', ...) and 
- * matching line in reference 'start' is updated with the next line number.
+ * and the 'stop' line (*excluding* the 'stop' line). Returns the type
+ * ('a', 'c', ...) and matching line in reference 'start' is updated with the
+ * next line number.
  */
 static char get_sdp_line(int *start, int stop, struct sip_request *req, const char **value)
 {
        char type = '\0';
        const char *line = NULL;
 
-       if (stop > req->sdp_end || stop < req->sdp_start) stop = req->sdp_end;
+       if (stop > req->sdp_end || stop < req->sdp_start) stop = req->sdp_end + 1;
 
        while (*start < stop) {
                line = REQ_OFFSET_TO_STR(req, line[(*start)++]);