فهرست منبع

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

Broken in d00ceda2c04.
Maksym Sobolyev 2 سال پیش
والد
کامیت
2750e48b54
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      src/modules/rtpproxy/rtpproxy.c

+ 2 - 1
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)