]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add a NULL string to the Image Execution Information Table if the Name is NULL in...
authorsfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 12 Dec 2012 03:03:07 +0000 (03:03 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 12 Dec 2012 03:03:07 +0000 (03:03 +0000)
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Dong Guo <guo.dong@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13990 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c

index c41a379b8a24157f61d95c7f7dbcd340f487c905..3b4fc57cb2ed6e1c72ff95894f422831834f1ba5 100644 (file)
@@ -715,14 +715,15 @@ AddImageExeInfo (
 \r
   if (Name != NULL) {\r
     NameStringLen = StrSize (Name);\r
+  } else {\r
+    NameStringLen = sizeof (CHAR16);\r
   }\r
 \r
-  ImageExeInfoTable = NULL;\r
   EfiGetSystemConfigurationTable (&gEfiImageSecurityDatabaseGuid, (VOID **) &ImageExeInfoTable);\r
   if (ImageExeInfoTable != NULL) {\r
     //\r
     // The table has been found!\r
-    // We must enlarge the table to accmodate the new exe info entry.\r
+    // We must enlarge the table to accomodate the new exe info entry.\r
     //\r
     ImageExeInfoTableSize = GetImageExeInfoTableSize (ImageExeInfoTable);\r
   } else {\r
@@ -755,6 +756,8 @@ AddImageExeInfo (
 \r
   if (Name != NULL) {\r
     CopyMem ((UINT8 *) &ImageExeInfoEntry->InfoSize + sizeof (UINT32), Name, NameStringLen);\r
+  } else {\r
+    ZeroMem ((UINT8 *) &ImageExeInfoEntry->InfoSize + sizeof (UINT32), sizeof (CHAR16));\r
   }\r
   CopyMem (\r
     (UINT8 *) &ImageExeInfoEntry->InfoSize + sizeof (UINT32) + NameStringLen,\r