[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/12] hw/core/loader: gunzip(): initialize z_stream
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 10/12] hw/core/loader: gunzip(): initialize z_stream |
Date: |
Mon, 25 Sep 2023 22:40:38 +0300 |
Coverity signals that variable as being used uninitialized. And really,
when work with external APIs that's better to zero out the structure,
where we set some fields by hand.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
hw/core/loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 4b67543046..aa02b27089 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -573,7 +573,7 @@ static void zfree(void *x, void *addr)
ssize_t gunzip(void *dst, size_t dstlen, uint8_t *src, size_t srclen)
{
- z_stream s;
+ z_stream s = {0};
ssize_t dstbytes;
int r, i, flags;
--
2.34.1
- [PATCH 05/12] device_tree: qmp_dumpdtb(): stronger assertion, (continued)
- [PATCH 05/12] device_tree: qmp_dumpdtb(): stronger assertion, Vladimir Sementsov-Ogievskiy, 2023/09/25
- [PATCH 06/12] mc146818rtc: rtc_set_time(): initialize tm to zeroes, Vladimir Sementsov-Ogievskiy, 2023/09/25
- [PATCH 08/12] block/nvme: nvme_process_completion() fix bound for cid, Vladimir Sementsov-Ogievskiy, 2023/09/25
- [PATCH 07/12] pcie_sriov: unregister_vfs(): fix error path, Vladimir Sementsov-Ogievskiy, 2023/09/25
- [PATCH 10/12] hw/core/loader: gunzip(): initialize z_stream,
Vladimir Sementsov-Ogievskiy <=
- [PATCH 11/12] hw/core/loader: read_targphys(): add upper bound, Vladimir Sementsov-Ogievskiy, 2023/09/25
- [PATCH 12/12] io/channel-socket: qio_channel_socket_flush(): improve msg validation, Vladimir Sementsov-Ogievskiy, 2023/09/25
- [PATCH 09/12] kvm-all: introduce limits for name_size and num_desc, Vladimir Sementsov-Ogievskiy, 2023/09/25