From 253c7ec9a58e71dd0f523b72635f8a5487519609 Mon Sep 17 00:00:00 2001 From: jsg Date: Sat, 1 Apr 2023 06:39:03 +0000 Subject: [PATCH] avoid use of uninitialised memory ok mlarkin@ --- usr.sbin/vmd/vioscsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 @@ -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 */ -- 2.20.1