[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 7/8] hw/core/loader: gunzip(): initialize z_stream
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 7/8] hw/core/loader: gunzip(): initialize z_stream |
Date: |
Tue, 26 Sep 2023 23:15:31 +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 4dd5a71fb7..b7bb44b7f7 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -558,7 +558,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 = {};
ssize_t dstbytes;
int r, i, flags;
--
2.34.1
- Re: [PATCH v2 2/8] util/filemonitor-inotify: qemu_file_monitor_watch(): assert no overflow, (continued)
- [PATCH v2 4/8] mc146818rtc: rtc_set_time(): initialize tm to zeroes, Vladimir Sementsov-Ogievskiy, 2023/09/26
- [PATCH v2 6/8] block/nvme: nvme_process_completion() fix bound for cid, Vladimir Sementsov-Ogievskiy, 2023/09/26
- [PATCH v2 1/8] hw/i386/intel_iommu: vtd_slpte_nonzero_rsvd(): assert no overflow, Vladimir Sementsov-Ogievskiy, 2023/09/26
- [PATCH v2 5/8] pcie_sriov: unregister_vfs(): fix error path, Vladimir Sementsov-Ogievskiy, 2023/09/26
- [PATCH v2 8/8] io/channel-socket: qio_channel_socket_flush(): improve msg validation, Vladimir Sementsov-Ogievskiy, 2023/09/26
- [PATCH v2 7/8] hw/core/loader: gunzip(): initialize z_stream,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 3/8] libvhost-user.c: add assertion to vu_message_read_default, Vladimir Sementsov-Ogievskiy, 2023/09/26
- Re: [PATCH v2 0/8] coverity fixes, Maksim Davydov, 2023/09/27