summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-11-02 01:42:51 +0000
committerlzeng14 <lzeng14@Edk2>2015-11-02 01:42:51 +0000
commit8aa6ebe83f91fcd5e1a67d316e444f4ac8b1319d (patch)
tree0fa60a0985da59473cb68dc94d989d82ed30ecf2 /MdeModulePkg/Universal
parentdf60fb4cc2ca896fcea9e37b06c276d569f1a6b8 (diff)
downloadedk2-platforms-8aa6ebe83f91fcd5e1a67d316e444f4ac8b1319d.tar.xz
MdeModulePkg SmbiosMeasurementDxe: NULL check to String from GetSmbiosStringById
When StringId is not 0, String returned from GetSmbiosStringById is expected to non-NULL. Add ASSERT (String != NULL); to ensure this. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Shumin Qiu <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18713 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
index 5aafabfced..f9e0196677 100644
--- a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
+++ b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c
@@ -286,6 +286,7 @@ FilterSmbiosEntry (
if (StringId != 0) {
// set ' ' for string field
String = GetSmbiosStringById (TableEntry, StringId, &StringLen);
+ ASSERT (String != NULL);
//DEBUG ((EFI_D_INFO,"StrId(0x%x)-%a(%d)\n", StringId, String, StringLen));
SetMem (String, StringLen, ' ');
}