Module: kamailio
Branch: master
Commit: 9825a757a059cc6fa2fc58f24f4eff9a528f1e49
URL: 
https://github.com/kamailio/kamailio/commit/9825a757a059cc6fa2fc58f24f4eff9a528f1e49

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-05-14T12:43:20+02:00

core: sdp parser - check char search result in  extract_bwidth()

---

Modified: src/core/parser/sdp/sdp_helpr_funcs.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/9825a757a059cc6fa2fc58f24f4eff9a528f1e49.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9825a757a059cc6fa2fc58f24f4eff9a528f1e49.patch

---

diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c 
b/src/core/parser/sdp/sdp_helpr_funcs.c
index 05578963760..2b8215738a4 100644
--- a/src/core/parser/sdp/sdp_helpr_funcs.c
+++ b/src/core/parser/sdp/sdp_helpr_funcs.c
@@ -510,6 +510,10 @@ int extract_bwidth(str *body, str *bwtype, str *bwwitdth)
        cp = bwtype->s;
        len = bwtype->len;
        cp1 = (char *)ser_memmem(cp, ":", len, 1);
+       if(cp1 == NULL) {
+               LM_ERR("invalid encoding in `b=%.*s'\n", bwtype->len, 
bwtype->s);
+               return -1;
+       }
        len -= cp1 - cp;
        if(len <= 0) {
                LM_ERR("invalid encoding in `b=%.*s'\n", bwtype->len, 
bwtype->s);

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to