diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-23 14:21:44 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-23 14:21:44 +0000 |
commit | 1ab2831766fda085f9a287b27499d6b7d54eab57 (patch) | |
tree | 20446f09ef169846b7b4de11d98fbd0c30179fb8 /channels | |
parent | 48426ee93eb61b4f8ec72962e3c2ab52ae3a34c6 (diff) |
Merged revisions 230773 via svnmerge from
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: http://svn.digium.com/svn/asterisk/branches/1.6.2@230796 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b36abecaf..8a09c10e7 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6792,7 +6792,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; @@ -6802,15 +6802,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)++]); |