]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
MdeModulePkg:Modify the incorrect DestStr length in safe string functions
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / Database.c
index 7ea2e723a50eda93b1e15c2eea612f2584e3c3b7..ec56795ebb1924942403472a062cc3129aecbc8c 100644 (file)
@@ -1182,7 +1182,7 @@ InsertFontPackage (
   }\r
   FontInfo->FontStyle = FontPkgHdr->FontStyle;\r
   FontInfo->FontSize  = FontPkgHdr->Cell.Height;\r
-  StrCpyS (FontInfo->FontName, sizeof (FontInfo->FontName) / sizeof (CHAR16), FontPkgHdr->FontFamily);\r
+  StrCpyS (FontInfo->FontName, (FontInfoSize - OFFSET_OF(EFI_FONT_INFO,FontName)) / sizeof (CHAR16), FontPkgHdr->FontFamily);\r
 \r
   if (IsFontInfoExisted (Private, FontInfo, NULL, NULL, NULL)) {\r
     Status = EFI_UNSUPPORTED;\r