]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg SmbiosMeasurementDxe: NULL check to String from GetSmbiosStringById
authorStar Zeng <star.zeng@intel.com>
Mon, 2 Nov 2015 01:42:51 +0000 (01:42 +0000)
committerlzeng14 <lzeng14@Edk2>
Mon, 2 Nov 2015 01:42:51 +0000 (01:42 +0000)
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

MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c

index 5aafabfcedaf521455bef683ec1b3641e806adb4..f9e0196677a9d5fead7651743f8411dd9eb836d2 100644 (file)
@@ -286,6 +286,7 @@ FilterSmbiosEntry (
           if (StringId != 0) {\r
             // set ' ' for string field\r
             String = GetSmbiosStringById (TableEntry, StringId, &StringLen);\r
+            ASSERT (String != NULL);\r
             //DEBUG ((EFI_D_INFO,"StrId(0x%x)-%a(%d)\n", StringId, String, StringLen));\r
             SetMem (String, StringLen, ' ');\r
           }\r