diff options
| author | PaddyDeng <v-paddydeng@microsoft.com> | 2025-04-07 04:48:50 +0300 |
|---|---|---|
| committer | Liming Gao <gaoliming@byosoft.com.cn> | 2025-05-05 09:26:16 +0300 |
| commit | 2cff8743ced9c2f79014a19077e91537fb938bb8 (patch) | |
| tree | 3a33c23edde7b89bf5f4fc306237ce380dce2798 /BaseTools/Source/Python/build/BuildReport.py | |
| parent | 02ec228654b8e17d3966f29f99fde9cc22152d4d (diff) | |
| download | edk2-2cff8743ced9c2f79014a19077e91537fb938bb8.tar.xz | |
MdeModulePkg/Spi: Solving potential null ptr deref. in SpiNorFlashJedecSfdp
The pointer `Instance->SfdpBasicFlash` can be used before initializing.
Example code flow:
- CreateSpiNorFlashSfdpInstance: Allocate pool for `Instance`
- InitialSpiNorFlashSfdpInstance
- ReadSfdp
- ReadSfdpHeader
- FillWriteBuffer: Dereferencing
`Instance->SfdpBasicFlash`
- ReadSfdpBasicParameterTable: Allocate pool for
`Instance->SfdpBasicFlash`
Check both `Instance` and `Instance->SfdpBasicFlash` should have
a non null value before dereferencing it. Otherwise use the defaut
value 0.
Also terminate the function if `Instance` or `WriteBuffer` is NULL.
Signed-off-by: Paddy Deng <v-paddydeng@microsoft.com>
Diffstat (limited to 'BaseTools/Source/Python/build/BuildReport.py')
0 files changed, 0 insertions, 0 deletions
