Module: kamailio Branch: master Commit: d10257fbfdbb3e3e73c0fe60a224585822bdd7b3 URL: https://github.com/kamailio/kamailio/commit/d10257fbfdbb3e3e73c0fe60a2245858...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-10-26T07:46:01+02:00
core: parser sdp - check len gor extracting fmtp
---
Modified: src/core/parser/sdp/sdp_helpr_funcs.c
---
Diff: https://github.com/kamailio/kamailio/commit/d10257fbfdbb3e3e73c0fe60a2245858... Patch: https://github.com/kamailio/kamailio/commit/d10257fbfdbb3e3e73c0fe60a2245858...
---
diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c b/src/core/parser/sdp/sdp_helpr_funcs.c index fe5b464e473..0e61fe5ca5d 100644 --- a/src/core/parser/sdp/sdp_helpr_funcs.c +++ b/src/core/parser/sdp/sdp_helpr_funcs.c @@ -218,8 +218,12 @@ int extract_fmtp(str *body, str *fmtp_payload, str *fmtp_string) char *cp, *cp1; int len;
+ if(body->len <= 7) { + return -1; + } if(strncasecmp(body->s, "a=fmtp:", 7) != 0) { - /*LM_DBG("We are not pointing to an a=fmtp: attribute =>`%.*s'\n", body->len, body->s); */ + /*LM_DBG("We are not pointing to an a=fmtp: attribute =>`%.*s'\n", + * body->len, body->s); */ return -1; }