Skip to content

Commit bb720e4

Browse files
authored
MdeModulePkg/PiSmmIpl: Prevent freeing from uninitialized pointers (#1486)
## Description There are error cases where the `Done` section of `GetFullSmramRanges()` can call `FreePool()` on uninitialized pointers. These cases trigger clang error `-Wsometimes-uninitialized`. - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? - [x] Backport to release branch? ## How This Was Tested Build success on CLANGPDB toolchain with LLVM 20.1.8 ## Integration Instructions N/A
1 parent ca6d16c commit bb720e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,10 @@ GetFullSmramRanges (
16191619
// MU_CHANGE Start - CodeQL Change
16201620
BOOLEAN Failed;
16211621

1622-
Failed = FALSE;
1622+
TempSmramRanges = NULL;
1623+
SmramRanges = NULL;
1624+
SmramReservedRanges = NULL;
1625+
Failed = FALSE;
16231626
// MU_CHANGE End - CodeQL Change
16241627

16251628
//

0 commit comments

Comments
 (0)