Skip to content

Commit

Permalink
SourceLevelDebugPkg DebugCommLibUsb3: Address NULL ptr dereference case
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Hao A Wu <[email protected]>
  • Loading branch information
lzeng14 authored and hwu25 committed Aug 12, 2019
1 parent 1a624dd commit 4053587
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4053587

Please sign in to comment.