qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]