From 95664069c5e1a45ad1fd99c24de4a3d028f7b855 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 14 Sep 2017 11:45:33 +0200 Subject: [PATCH] satip server: the data must for satip_rtp_tcp_data() must be allocated, fixes #4573 --- src/satip/rtp.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/satip/rtp.c b/src/satip/rtp.c index 040eeb46b8..d0d88fafd5 100644 --- a/src/satip/rtp.c +++ b/src/satip/rtp.c @@ -907,7 +907,7 @@ satip_rtcp_thread(void *aux) { satip_rtp_session_t *rtp; int64_t us; - uint8_t msg[RTCP_PAYLOAD+1]; + uint8_t msg[RTCP_PAYLOAD+1], *msg1; char addrbuf[50]; int r, len, err; @@ -932,8 +932,15 @@ satip_rtcp_thread(void *aux) tvhtrace(LS_SATIPS, "RTCP send to %s:%d : %s", addrbuf, ntohs(IP_PORT(rtp->peer2)), msg + 16); } if (rtp->port == RTSP_TCP_DATA) { - err = satip_rtp_tcp_data(rtp, 1, msg, len); - r = err ? -1 : 0; + msg1 = malloc(len); + if (msg1) { + memcpy(msg1, msg, len); + err = satip_rtp_tcp_data(rtp, 1, msg1, len); + r = err ? -1 : 0; + } else { + r = -1; + err = ENOMEM; + } } else { r = sendto(rtp->fd_rtcp, msg, len, 0, (struct sockaddr*)&rtp->peer2,