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

Author: Maksym Sobolyev <[email protected]>
Committer: Victor Seva <[email protected]>
Date: 2023-07-26T14:46:45+02:00

rtpproxy: make sure we null terminate the copy of the string.

Broken in d00ceda2c04.

---

Modified: src/modules/rtpproxy/rtpproxy.c

---

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

---

diff --git a/src/modules/rtpproxy/rtpproxy.c b/src/modules/rtpproxy/rtpproxy.c
index 8103fef4edd..9d7190cabc3 100644
--- a/src/modules/rtpproxy/rtpproxy.c
+++ b/src/modules/rtpproxy/rtpproxy.c
@@ -1698,7 +1698,8 @@ static int rtpproxy_manage(struct sip_msg *msg, char 
*flags, char *ip)
        if(ip == NULL) {
                cp.s = ip_addr2a(&msg->rcv.dst_ip);
                cp.len = strlen(cp.s);
-               memcpy(newip, cp.s, cp.len);
+               /* Copy, including teminating \0 */
+               memcpy(newip, cp.s, cp.len + 1);
        }
 
        if(msg->msg_flags & FL_SDP_BODY)

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to