Initialize Storage->ConfigRequest to contain at least one Unicode NULL '\0000'. CONFIG_REQUEST_STRING_INCREMENTAL is designed to only host valid string without the trailing '\0000'.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4700 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2008-02-19 02:21:25 +00:00
parent 404d4e5c60
commit c7b616cf09

View File

@ -353,7 +353,7 @@ InitializeRequestElement (
//
// Old String buffer is not sufficient for RequestElement, allocate a new one
//
StringSize = (Storage->ConfigRequest != NULL) ? StrSize (Storage->ConfigRequest) : 0;
StringSize = (Storage->ConfigRequest != NULL) ? StrSize (Storage->ConfigRequest) : sizeof (CHAR16);
NewStr = AllocateZeroPool (StringSize + CONFIG_REQUEST_STRING_INCREMENTAL * sizeof (CHAR16));
if (Storage->ConfigRequest != NULL) {
CopyMem (NewStr, Storage->ConfigRequest, StringSize);