Blame SOURCES/0389-net-tftp-Fix-dangling-memory-pointer.patch

80913e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
80913e
From: Darren Kenny <darren.kenny@oracle.com>
80913e
Date: Fri, 19 Feb 2021 17:12:23 +0000
80913e
Subject: [PATCH] net/tftp: Fix dangling memory pointer
80913e
80913e
The static code analysis tool, Parfait, reported that the valid of
80913e
file->data was left referencing memory that was freed by the call to
80913e
grub_free(data) where data was initialized from file->data.
80913e
80913e
To ensure that there is no unintentional access to this memory
80913e
referenced by file->data we should set the pointer to NULL.
80913e
80913e
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
80913e
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
80913e
---
80913e
 grub-core/net/tftp.c | 1 +
80913e
 1 file changed, 1 insertion(+)
80913e
80913e
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
80913e
index b9a4b607a3d..aa0424dcee3 100644
80913e
--- a/grub-core/net/tftp.c
80913e
+++ b/grub-core/net/tftp.c
80913e
@@ -444,6 +444,7 @@ tftp_close (struct grub_file *file)
80913e
       grub_net_udp_close (data->sock);
80913e
     }
80913e
   grub_free (data);
80913e
+  file->data = NULL;
80913e
   return GRUB_ERR_NONE;
80913e
 }
80913e