[FFmpeg-cvslog] lavfi/zmq: Avoid mem copy past the end of input buffer

Andriy Gelman git at videolan.org
Thu Aug 1 20:10:14 EEST 2019


ffmpeg | branch: master | Andriy Gelman <andriy.gelman at gmail.com> | Tue Jul 30 17:16:08 2019 -0400| [f60b1211b2aa7b6e8902d64072b678b4ccd87e54] | committer: Carl Eugen Hoyos

lavfi/zmq: Avoid mem copy past the end of input buffer

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f60b1211b2aa7b6e8902d64072b678b4ccd87e54
---

 libavfilter/f_zmq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/f_zmq.c b/libavfilter/f_zmq.c
index 89da5bef06..744c721305 100644
--- a/libavfilter/f_zmq.c
+++ b/libavfilter/f_zmq.c
@@ -139,7 +139,7 @@ static int recv_msg(AVFilterContext *ctx, char **buf, int *buf_size)
         ret = AVERROR(ENOMEM);
         goto end;
     }
-    memcpy(*buf, zmq_msg_data(&msg), *buf_size);
+    memcpy(*buf, zmq_msg_data(&msg), *buf_size - 1);
     (*buf)[*buf_size-1] = 0;
 
 end:



More information about the ffmpeg-cvslog mailing list