diff options
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 2cad6d29f4..d492b769d5 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -5497,7 +5497,6 @@ HiiBlockToConfig ( UINTN Index;
UINT8 *TemBuffer;
CHAR16 *TemString;
- CHAR16 TemChar;
TmpBuffer = NULL;
@@ -5564,10 +5563,13 @@ HiiBlockToConfig ( //
// Copy <ConfigHdr> and an additional '&' to <ConfigResp>
//
- TemChar = *StringPtr;
- *StringPtr = '\0';
- AppendToMultiString(Config, ConfigRequest);
- *StringPtr = TemChar;
+ TemString = AllocateCopyPool (sizeof (CHAR16) * (StringPtr - ConfigRequest + 1), ConfigRequest);
+ if (TemString == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+ TemString[StringPtr - ConfigRequest] = '\0';
+ AppendToMultiString(Config, TemString);
+ FreePool (TemString);
//
// Parse each <RequestElement> if exists
|