From 2c6239afef4f1a7c923b59c62b780224f3e4bafa Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 2 Oct 2023 14:33:13 +0100 Subject: replace bcopy() with memcpy() (#786) For some unclear reason, clang-tidy believes bcopy() is insecure. Regardless, it is deprecated, so replace usages with memcpy(). Signed-off-by: John Levon Reviewed-by: Thanos Makatos --- lib/tran_pipe.c | 5 +++-- lib/tran_sock.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/tran_pipe.c b/lib/tran_pipe.c index 8fb605c..4c3dc9c 100644 --- a/lib/tran_pipe.c +++ b/lib/tran_pipe.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "tran_pipe.h" @@ -397,8 +398,8 @@ tran_pipe_reply(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg, int err) } if (msg->out_iovecs != NULL) { - bcopy(msg->out_iovecs, iovecs + 1, - msg->nr_out_iovecs * sizeof(*iovecs)); + memcpy(iovecs + 1, msg->out_iovecs, + msg->nr_out_iovecs * sizeof(*iovecs)); } else { iovecs[1].iov_base = msg->out.iov.iov_base; iovecs[1].iov_len = msg->out.iov.iov_len; diff --git a/lib/tran_sock.c b/lib/tran_sock.c index 8a652c7..024e5b0 100644 --- a/lib/tran_sock.c +++ b/lib/tran_sock.c @@ -593,8 +593,8 @@ tran_sock_reply(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg, int err) } if (msg->out_iovecs != NULL) { - bcopy(msg->out_iovecs, iovecs + 1, - msg->nr_out_iovecs * sizeof(*iovecs)); + memcpy(iovecs + 1, msg->out_iovecs, + msg->nr_out_iovecs * sizeof(*iovecs)); } else { iovecs[1].iov_base = msg->out.iov.iov_base; iovecs[1].iov_len = msg->out.iov.iov_len; -- cgit v1.1