summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-04-01 06:39:04 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-04-01 06:39:04 +0000
commitbdf1f4fa5716794f04a9fc4271087833f739bf0b (patch)
tree16c4ee39e9f40bc3886129142ebc0b7b614676a8
parent59edc8ffdc5a2b78fe6dc74efac20f44b703ef71 (diff)
avoid use of uninitialised memory
ok mlarkin@
-rw-r--r--usr.sbin/vmd/vioscsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/vmd/vioscsi.c b/usr.sbin/vmd/vioscsi.c
index 7e53d914367..48d65fc2455 100644
--- a/usr.sbin/vmd/vioscsi.c
+++ b/usr.sbin/vmd/vioscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vioscsi.c,v 1.22 2022/12/23 19:25:22 dv Exp $ */
+/* $OpenBSD: vioscsi.c,v 1.23 2023/04/01 06:39:03 jsg Exp $ */
/*
* Copyright (c) 2017 Carlos Cardenas <ccardenas@openbsd.org>
@@ -1333,6 +1333,7 @@ vioscsi_handle_read_toc(struct vioscsi_dev *dev,
toc_data_len = toc_data_p - toc_data;
_lto2b((uint32_t)toc_data_len - 2, toc_data);
+ memset(&resp, 0, sizeof(resp));
vioscsi_prepare_resp(&resp, VIRTIO_SCSI_S_OK, SCSI_OK, 0, 0, 0);
/* Move index for response */