}\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