aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-23 14:13:56 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-23 14:13:56 +0000
commitf03ce510ecc387c452ed94ebf4e5f81b7f191819 (patch)
treeb6fe3e062cea2829acaffccf1341c6a89494995c /channels
parent870bd608af786a986f2c6d160ef72af4fd4946c7 (diff)
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.4@230772 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 368de4b58..52ce80a6d 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4367,7 +4367,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->line[(*start)++], name, len);
if (r[0] != '\0')
return r;
@@ -4377,15 +4377,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->line[(*start)++];