mirror of https://github.com/acidanthera/audk.git
Fix a bug in variable driver cache mechanism:
It should return EFI_SUCCESS and update the output buffer size if the input buffer is larger than actual variable contents. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4182 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ad4dc92d61
commit
aa09397b3c
|
@ -676,11 +676,12 @@ FindVariableInCache (
|
|||
if (Entry->DataSize == 0) {
|
||||
// Variable was deleted so return not found
|
||||
return EFI_NOT_FOUND;
|
||||
} else if (Entry->DataSize != *DataSize) {
|
||||
} else if (Entry->DataSize > *DataSize) {
|
||||
// If the buffer is too small return correct size
|
||||
*DataSize = Entry->DataSize;
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
} else {
|
||||
*DataSize = Entry->DataSize;
|
||||
// Return the data
|
||||
CopyMem (Data, Entry->Data, Entry->DataSize);
|
||||
if (Attributes != NULL) {
|
||||
|
|
Loading…
Reference in New Issue