45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
From 3b2b7d0c9a886d913062ed5a9ffa8b764d882540 Mon Sep 17 00:00:00 2001
|
||
Message-Id: <3b2b7d0c9a886d913062ed5a9ffa8b764d882540.1652945863.git.stefan@agner.ch>
|
||
In-Reply-To: <184b6a054e04bb4c7fb4885a30d62314229dc551.1652945863.git.stefan@agner.ch>
|
||
References: <184b6a054e04bb4c7fb4885a30d62314229dc551.1652945863.git.stefan@agner.ch>
|
||
From: Peter Jones <pjones@redhat.com>
|
||
Date: Mon, 27 Jan 2020 15:01:16 -0500
|
||
Subject: [PATCH] squash4: Fix an uninitialized variable
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
|
||
gcc says:
|
||
|
||
grub-core/fs/squash4.c: In function ‘direct_read’:
|
||
grub-core/fs/squash4.c:868:10: error: ‘err’ may be used uninitialized in
|
||
this function [-Werror=maybe-uninitialized]
|
||
868 | if (err)
|
||
| ^
|
||
cc1: all warnings being treated as errors
|
||
|
||
This patch initializes it to GRUB_ERR_NONE.
|
||
|
||
Signed-off-by: Peter Jones <pjones@redhat.com>
|
||
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
|
||
---
|
||
grub-core/fs/squash4.c | 2 +-
|
||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
||
diff --git a/grub-core/fs/squash4.c b/grub-core/fs/squash4.c
|
||
index 95d5c1e1f..82704f966 100644
|
||
--- a/grub-core/fs/squash4.c
|
||
+++ b/grub-core/fs/squash4.c
|
||
@@ -746,7 +746,7 @@ direct_read (struct grub_squash_data *data,
|
||
struct grub_squash_cache_inode *ino,
|
||
grub_off_t off, char *buf, grub_size_t len)
|
||
{
|
||
- grub_err_t err;
|
||
+ grub_err_t err = GRUB_ERR_NONE;
|
||
grub_off_t cumulated_uncompressed_size = 0;
|
||
grub_uint64_t a = 0;
|
||
grub_size_t i;
|
||
--
|
||
2.36.1
|
||
|