Module: kamailio
Branch: master
Commit: d4bbde619bbf808edebb31e131b3783ba2a4b34d
URL:
https://github.com/kamailio/kamailio/commit/d4bbde619bbf808edebb31e131b3783…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-10-11T12:00:53+02:00
core: parse sdp - check for body limit on mixed content
---
Modified: src/core/parser/sdp/sdp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d4bbde619bbf808edebb31e131b3783…
Patch:
https://github.com/kamailio/kamailio/commit/d4bbde619bbf808edebb31e131b3783…
---
diff --git a/src/core/parser/sdp/sdp.c b/src/core/parser/sdp/sdp.c
index 52e967a3db9..06fc411f502 100644
--- a/src/core/parser/sdp/sdp.c
+++ b/src/core/parser/sdp/sdp.c
@@ -810,9 +810,11 @@ static int parse_mixed_content(str *mixed_body, str delimiter,
sdp_info_t *_sdp)
} /* end of while */
/* and now we need to parse the content */
if(start_parsing) {
- while(('\n' == *rest) || ('\r' == *rest) || ('\t' == *rest)
- || (' ' == *rest))
+ while((rest < bodylimit)
+ && (('\n' == *rest) || ('\r' == *rest) || ('\t' ==
*rest)
+ || (' ' == *rest))) {
rest++; /* Skip any whitespace */
+ }
_sdp->raw_sdp.s = rest;
_sdp->raw_sdp.len = d2p - rest;
/* LM_DBG("we need to check session %d: <%.*s>\n", session_num,
_sdp.raw_sdp.len, _sdp.raw_sdp.s); */