X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkModulePkg%2FLibrary%2FEdkIfrSupportLib%2FIfrVariable.c;h=a4aab0ff01ebf7e70588616eb3ee55374cdfab5f;hp=3e37553668eccd3037e34a0d81a89c01b8bed485;hb=1cc8ee7861a59532700a6fd1255689576eda0f52;hpb=582510249f2fb1334e507b99421b9485f6b89159 diff --git a/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c b/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c index 3e37553668..a4aab0ff01 100644 --- a/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c +++ b/EdkModulePkg/Library/EdkIfrSupportLib/IfrVariable.c @@ -467,11 +467,15 @@ Returns: { EFI_STATUS Status; CHAR16 *NameSuffixed; + UINTN NameLength; + UINTN SuffixLength; // // enough to concatenate both strings. // - NameSuffixed = AllocateZeroPool ((StrLen (Name) + StrLen (Suffix) + 1) * sizeof (CHAR16)); + NameLength = StrLen (Name); + SuffixLength = StrLen (Suffix); + NameSuffixed = AllocateZeroPool ((NameLength + SuffixLength + 1) * sizeof (CHAR16)); StrCpy (NameSuffixed, Name); StrCat (NameSuffixed, Suffix);