diff options
author | John Levon <john.levon@nutanix.com> | 2023-10-02 14:33:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 14:33:13 +0100 |
commit | 2c6239afef4f1a7c923b59c62b780224f3e4bafa (patch) | |
tree | f54472cd4dd12f08ac3b9fe1598ebd90863f3fab /lib | |
parent | 8d38e8c57923f736ffc8215b7b237c76d240e3b4 (diff) | |
download | libvfio-user-2c6239afef4f1a7c923b59c62b780224f3e4bafa.zip libvfio-user-2c6239afef4f1a7c923b59c62b780224f3e4bafa.tar.gz libvfio-user-2c6239afef4f1a7c923b59c62b780224f3e4bafa.tar.bz2 |
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 <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tran_pipe.c | 5 | ||||
-rw-r--r-- | lib/tran_sock.c | 4 |
2 files changed, 5 insertions, 4 deletions
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 <assert.h> #include <errno.h> #include <stdlib.h> +#include <string.h> #include <strings.h> #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; |