]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip server: the data must for satip_rtp_tcp_data() must be allocated, fixes #4573
authorJaroslav Kysela <perex@perex.cz>
Thu, 14 Sep 2017 09:45:33 +0000 (11:45 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 Sep 2017 09:45:51 +0000 (11:45 +0200)
src/satip/rtp.c

index 040eeb46b88dfe9b8e507319603a1b5b2f06ba69..d0d88fafd511399ca03ba3a8e90acb93817ac11c 100644 (file)
@@ -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,