mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
Fixed memory leak and buffer overrun for string op-code.
Signed-off-by:ydong10 Reviewed-by:lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12213 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ce2f13a341
commit
ba944801a9
@ -2596,7 +2596,11 @@ GetQuestionDefault (
|
|||||||
if (StrValue == NULL) {
|
if (StrValue == NULL) {
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
Question->BufferValue = AllocateCopyPool (StrSize (StrValue), StrValue);
|
if (Question->StorageWidth > StrSize (StrValue)) {
|
||||||
|
CopyMem (Question->BufferValue, StrValue, StrSize (StrValue));
|
||||||
|
} else {
|
||||||
|
CopyMem (Question->BufferValue, StrValue, Question->StorageWidth);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user