summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2019-07-02 13:34:01 -0700
committerMichael D Kinney <michael.d.kinney@intel.com>2019-07-12 17:29:38 -0700
commit371f0ae7dd7fcfdbf45820ea1e9aabd83d8658cf (patch)
tree3cea69e69629e705653a624395aa06b55bf3564d
parent89e12827648ff2b3138ca2c2c0c29f5b46ff9185 (diff)
Vlvt2TbltDevicePkg: Fix NULL pointer access in SmbiosMiscDxe
Handle case where no Simple Network Protocols are found. Cc: Zailiang Sun <zailiang.sun@intel.com> Cc: Yi Qian <yi.qian@intel.com> Cc: Gary Lin <glin@suse.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Zailiang Sun <zailiang.sun@intel.com>
-rw-r--r--Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c14
-rw-r--r--Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c14
2 files changed, 18 insertions, 10 deletions
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c
index 4e024868..8eddc5c2 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c
@@ -130,11 +130,15 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer)
//
//Get the MAC string
//
- Status = NetLibGetMacString (
- *Handles,
- NULL,
- &MacStr
- );
+ if (Handles == NULL) {
+ Status = EFI_NOT_FOUND;
+ } else {
+ Status = NetLibGetMacString (
+ *Handles,
+ NULL,
+ &MacStr
+ );
+ }
if (EFI_ERROR (Status)) {
MacStr = L"000000000000";
}
diff --git a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
index da660cb3..b18dbd6a 100644
--- a/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
+++ b/Platform/Intel/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
@@ -212,11 +212,15 @@ AddSmbiosManuCallback (
//
//Get the MAC string
//
- Status = NetLibGetMacString (
- *Handles,
- NULL,
- &MacStr
- );
+ if (Handles == NULL) {
+ Status = EFI_NOT_FOUND;
+ } else {
+ Status = NetLibGetMacString (
+ *Handles,
+ NULL,
+ &MacStr
+ );
+ }
if (EFI_ERROR (Status)) {
MacStr = L"000000000000";
}