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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-10-11T11:41:02+02:00

core: parser sdp - check for length of sendrecv attribute

---

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

---

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

---

diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c 
b/src/core/parser/sdp/sdp_helpr_funcs.c
index a5dffd9c398..a5186fb4428 100644
--- a/src/core/parser/sdp/sdp_helpr_funcs.c
+++ b/src/core/parser/sdp/sdp_helpr_funcs.c
@@ -447,6 +447,9 @@ int extract_sendrecv_mode(str *body, str *sendrecv_mode, 
int *is_on_hold)
 {
        char *cp1;
 
+       if(body->len < 10) {
+               return -1;
+       }
        cp1 = body->s;
        if(!((strncasecmp(cp1, "a=sendrecv", 10) == 0)
                           || (strncasecmp(cp1, "a=recvonly", 10) == 0))) {

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to