Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
e70dcc8
)
Fix coverity issues in vhost-user code, fixes VPP-189
97/2397/1
author
Damjan Marion
<damarion@cisco.com>
Tue, 16 Aug 2016 10:37:24 +0000
(12:37 +0200)
committer
Damjan Marion
<damarion@cisco.com>
Tue, 16 Aug 2016 10:37:24 +0000
(12:37 +0200)
Change-Id: Ief95aac5d4451f411dbed8050528708c0b1b7732
Signed-off-by: Damjan Marion <damarion@cisco.com>
vnet/vnet/devices/virtio/vhost-user.c
patch
|
blob
|
history
diff --git
a/vnet/vnet/devices/virtio/vhost-user.c
b/vnet/vnet/devices/virtio/vhost-user.c
index
7dc7d0e
..
dca60f1
100644
(file)
--- a/
vnet/vnet/devices/virtio/vhost-user.c
+++ b/
vnet/vnet/devices/virtio/vhost-user.c
@@
-296,6
+296,9
@@
static clib_error_t * vhost_user_socket_read (unix_file_t * uf)
memset(&mh, 0, sizeof(mh));
memset(control, 0, sizeof(control));
+ for (i=0; i < VHOST_MEMORY_MAX_NREGIONS; i++)
+ fds[i] = -1;
+
/* set the payload */
iov[0].iov_base = (void *) &msg;
iov[0].iov_len = VHOST_USER_MSG_HDR_SZ;
@@
-1498,7
+1501,7
@@
static int vhost_user_init_server_sock(const char * sock_filename, int *sockfd)
}
un.sun_family = AF_UNIX;
- str
cpy((char *) un.sun_path, (char *) sock_filename
);
+ str
ncpy((char *) un.sun_path, (char *) sock_filename, sizeof(un.sun_path) - 1
);
/* remove if exists */
unlink( (char *) sock_filename);