diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-19 08:49:20 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-19 08:49:20 +0000 |
commit | aa09397b3c62c7b409135ed91edef8bd7bd33a73 (patch) | |
tree | 23d58c1cee6aa6db560ab631484c2900d5beb305 | |
parent | ad4dc92d616f24df1de49887d5fd194704cb5fc9 (diff) | |
download | edk2-platforms-aa09397b3c62c7b409135ed91edef8bd7bd33a73.tar.xz |
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
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 34bc4a8e15..20eeebe54c 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -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) {
|