public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-libc Patch] StdLib/LibC/Uefi/Devices/Utility: Fix use after free
@ 2021-08-18 23:45 Michael D Kinney
  2021-08-19  1:45 ` Rebecca Cran
  0 siblings, 1 reply; 2+ messages in thread
From: Michael D Kinney @ 2021-08-18 23:45 UTC (permalink / raw)
  To: devel; +Cc: Rebecca Cran

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=38

Set MPath to NULL after free(MPath) to guarantee that MPath
is not used after the free() call.

Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 StdLib/LibC/Uefi/Devices/Utility/Path.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/StdLib/LibC/Uefi/Devices/Utility/Path.c b/StdLib/LibC/Uefi/Devices/Utility/Path.c
index d6728d3..fe19196 100644
--- a/StdLib/LibC/Uefi/Devices/Utility/Path.c
+++ b/StdLib/LibC/Uefi/Devices/Utility/Path.c
@@ -359,6 +359,7 @@ reclassify:
     }
     else if(MPath != NULL) {
       free(MPath);    /* Caller doesn't want it so let MPath go free */
+      MPath = NULL;
     }
 
     /*  At this point, WPath is an absolute path,
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-19  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-18 23:45 [edk2-libc Patch] StdLib/LibC/Uefi/Devices/Utility: Fix use after free Michael D Kinney
2021-08-19  1:45 ` Rebecca Cran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox