Browse Source

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

tags/n4.3
Andriy Gelman Carl Eugen Hoyos 5 years ago
parent
commit
f60b1211b2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavfilter/f_zmq.c

+ 1
- 1
libavfilter/f_zmq.c View File

@@ -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:


Loading…
Cancel
Save