mirror of https://github.com/acidanthera/audk.git
SourceLevelDebugPkg DebugCommLibUsb3: Address NULL ptr dereference case
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2051 Original code GetConfigTable for AddrPtr first, if failed, InstalConfigTable with allocated AddrPtr. So the AddrPtr should not be NULL and the NULL pointer dereference case should be false positive. This patch is just to address the case raised from static analysis. Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
parent
1a624dd7cf
commit
4053587347
|
@ -447,7 +447,7 @@ DebugCommunicationUsb3DxeConstructor (
|
|||
EFI_EVENT Event;
|
||||
|
||||
Status = EfiGetSystemConfigurationTable (&gUsb3DbgGuid, (VOID **) &AddrPtr);
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (EFI_ERROR (Status) || (AddrPtr == NULL)) {
|
||||
//
|
||||
// Instead of using local variables, install system configuration table for
|
||||
// the local instance and the buffer to save instance address pointer.
|
||||
|
|
Loading…
Reference in New Issue