diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2015-12-25 08:10:37 +0000 |
---|---|---|
committer | jiaxinwu <jiaxinwu@Edk2> | 2015-12-25 08:10:37 +0000 |
commit | 5346adbb18004b27a1ca428f40efa815c31f617e (patch) | |
tree | 77e5440f1610615e296e51895435434ed1f4523a /NetworkPkg/IScsiDxe/IScsiDriver.c | |
parent | 1254d3a9898eb4c257596842c29776a0d62c4cc7 (diff) | |
download | edk2-platforms-5346adbb18004b27a1ca428f40efa815c31f617e.tar.xz |
NetworkPkg: Fix suspicious dereference of pointer before NULL check
This patch is used to fix suspicious dereference of pointer before
NULL check in IScsiDxe driver.
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19552 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/IScsiDxe/IScsiDriver.c')
-rw-r--r-- | NetworkPkg/IScsiDxe/IScsiDriver.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c index a7031dfc4e..51ce16911b 100644 --- a/NetworkPkg/IScsiDxe/IScsiDriver.c +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c @@ -105,7 +105,8 @@ IScsiCheckAip ( //
// Check any AIP instances exist in system.
//
- AipHandleCount = 0;
+ AipHandleCount = 0;
+ AipHandleBuffer = NULL;
Status = gBS->LocateHandleBuffer (
ByProtocol,
&gEfiAdapterInformationProtocolGuid,
@@ -117,6 +118,8 @@ IScsiCheckAip ( return EFI_NOT_FOUND;
}
+ ASSERT (AipHandleBuffer != NULL);
+
InfoBlock = NULL;
for (AipIndex = 0; AipIndex < AipHandleCount; AipIndex++) {
|