summaryrefslogtreecommitdiffstats
path: root/DuetPkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-05-13 13:01:28 +0800
committerStar Zeng <star.zeng@intel.com>2016-05-15 17:48:53 +0800
commit053d95e7e5e37378f6b21fe19009423762be894f (patch)
treefac0e0887a58b9c6a71ef755ceb37ebf8d70f31c /DuetPkg
parente19eab615305b1490b2dee0de0360736be10f9a7 (diff)
downloadedk2-053d95e7e5e37378f6b21fe19009423762be894f.tar.gz
edk2-053d95e7e5e37378f6b21fe19009423762be894f.tar.bz2
edk2-053d95e7e5e37378f6b21fe19009423762be894f.zip
DuetPkg FSVariable: return error for empty str VariableName to GetVariable
Current GetVariable implementation will return the first variable for empty str VariableName, it is because GetVariable and GetNextVariablename are sharing same function FindVariable. But UEFI sepc defines SetVariable that If VariableName is an empty string, then EFI_INVALID_PARAMETER is returned, that means an empty string variable could never be set successfully, so GetVariable should return error for empty string VariableName. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'DuetPkg')
-rw-r--r--DuetPkg/FSVariable/FSVariable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/DuetPkg/FSVariable/FSVariable.c b/DuetPkg/FSVariable/FSVariable.c
index 06df161e5d..34b79305c8 100644
--- a/DuetPkg/FSVariable/FSVariable.c
+++ b/DuetPkg/FSVariable/FSVariable.c
@@ -1337,6 +1337,10 @@ Returns:
return EFI_INVALID_PARAMETER;
}
+ if (VariableName[0] == 0) {
+ return EFI_NOT_FOUND;
+ }
+
//
// Find existing variable
//