[linux-agent v1 1/5] virtio-port: initialize struct before memcpy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Victor Toso <me@xxxxxxxxxxxxxx>

Found by coverity:

 | uninit_use_in_call: Using uninitialized value "message_header". Field
 | "message_header.data" is uninitialized when calling "memcpy".

Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
---
 src/vdagentd/virtio-port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vdagentd/virtio-port.c b/src/vdagentd/virtio-port.c
index e48d107..7b148d5 100644
--- a/src/vdagentd/virtio-port.c
+++ b/src/vdagentd/virtio-port.c
@@ -198,7 +198,7 @@ void vdagent_virtio_port_write_start(
 {
     struct vdagent_virtio_port_buf *wbuf, *new_wbuf;
     VDIChunkHeader chunk_header;
-    VDAgentMessage message_header;
+    VDAgentMessage message_header = { 0, };
 
     new_wbuf = g_new(struct vdagent_virtio_port_buf, 1);
     new_wbuf->pos = 0;
-- 
2.19.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]