Module: kamailio Branch: master Commit: 3c1700fb7693c05025be1058e856fe610f4be031 URL: https://github.com/kamailio/kamailio/commit/3c1700fb7693c05025be1058e856fe610f4be031
Author: Victor Seva <[email protected]> Committer: Victor Seva <[email protected]> Date: 2023-07-26T14:55:17+02:00 rtpproxy: make sure we null terminate the copy of the string. bug introduced at d00ceda2c04 --- Modified: src/modules/rtpproxy/rtpproxy.c --- Diff: https://github.com/kamailio/kamailio/commit/3c1700fb7693c05025be1058e856fe610f4be031.diff Patch: https://github.com/kamailio/kamailio/commit/3c1700fb7693c05025be1058e856fe610f4be031.patch --- diff --git a/src/modules/rtpproxy/rtpproxy.c b/src/modules/rtpproxy/rtpproxy.c index 9d7190cabc3..bc252982e1c 100644 --- a/src/modules/rtpproxy/rtpproxy.c +++ b/src/modules/rtpproxy/rtpproxy.c @@ -1834,7 +1834,8 @@ static int rtpproxy_answer1_helper_f(struct sip_msg *msg, char *flags) 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); return force_rtp_proxy(msg, flags, newip, 0, 0); } _______________________________________________ Kamailio (SER) - Development Mailing List To unsubscribe send an email to [email protected]
