Skip to content
Snippets Groups Projects
Commit 1f759edd authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

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/trunk@230773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 417657f4
No related branches found
No related tags found
No related merge requests found
...@@ -7113,7 +7113,7 @@ static const char *get_sdp_iterate(int *start, struct sip_request *req, const ch ...@@ -7113,7 +7113,7 @@ static const char *get_sdp_iterate(int *start, struct sip_request *req, const ch
{ {
int len = strlen(name); 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, '='); const char *r = get_body_by_line(REQ_OFFSET_TO_STR(req, line[(*start)++]), name, len, '=');
if (r[0] != '\0') if (r[0] != '\0')
return r; return r;
...@@ -7123,15 +7123,16 @@ static const char *get_sdp_iterate(int *start, struct sip_request *req, const ch ...@@ -7123,15 +7123,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 /*! \brief Fetches the next valid SDP line between the 'start' line
* and the 'stop' line. Returns the type ('a', 'c', ...) and * and the 'stop' line (*excluding* the 'stop' line). Returns the type
* matching line in reference 'start' is updated with the next line number. * ('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) static char get_sdp_line(int *start, int stop, struct sip_request *req, const char **value)
{ {
char type = '\0'; char type = '\0';
const char *line = NULL; 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) { while (*start < stop) {
line = REQ_OFFSET_TO_STR(req, line[(*start)++]); line = REQ_OFFSET_TO_STR(req, line[(*start)++]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment