aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Philipson <ross.philipson@oracle.com>2022-07-14 09:41:28 -0400
committerDaniel Kiper <daniel.kiper@oracle.com>2022-07-27 19:20:53 +0200
commitf7f453e0bf1043d89587638ffd24b8c34631b8eb (patch)
tree19e738bef8b03e2ed559bbca43f69f9e92ed08dd
parent4c76565b6cb885b7e144dc27f3612066844e2d19 (diff)
downloadgrub-f7f453e0bf1043d89587638ffd24b8c34631b8eb.tar.gz
lib/relocator: Initialize local relocator subchunk struct to all zeros
The way the code is written the tofree variable would never be passed to the free_subchunk() function uninitialized. Coverity cannot determine this and flags the situation as "Using uninitialized value...". The fix is just to initialize the local struct. Fixes: CID 314016 Signed-off-by: Ross Philipson <ross.philipson@oracle.com> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Tested-by: Alec Brown <alec.r.brown@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
-rw-r--r--grub-core/lib/relocator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c
index 68ef1289a..bfcc70dac 100644
--- a/grub-core/lib/relocator.c
+++ b/grub-core/lib/relocator.c
@@ -989,7 +989,7 @@ malloc_in_range (struct grub_relocator *rel,
if (j != 0 && events[j - 1].pos != events[j].pos)
{
grub_addr_t alloc_start, alloc_end;
- struct grub_relocator_subchunk tofree;
+ struct grub_relocator_subchunk tofree = {0};
struct grub_relocator_subchunk *curschu = &tofree;
if (!oom)
curschu = &res->subchunks[cural];