diff options
author | Laszlo Ersek <lersek@redhat.com> | 2016-01-21 18:40:30 +0000 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-13 20:41:39 +0800 |
commit | 88e75ba717966e6711399c111d0fe04599282db6 (patch) | |
tree | 4a6d1b131727a668a828ac215d6ae766796930b6 | |
parent | 646690d296572fbc500090cb18da4fb172d4f044 (diff) | |
download | edk2-platforms-88e75ba717966e6711399c111d0fe04599282db6.tar.xz |
ShellPkg: BcfgDisplayDump(): fix reporting of OptionalData
In this cleaned up form of BcfgDisplayDump(), it is easier to see that the
OptionalDataOffset <= BufferSize
expression, used to report whether optional data are *absent*, is
incorrect. For any well-formed EFI_LOAD_OPTION, this inequality always
holds.
Optional data are present exactly if
OptionalDataOffset < BufferSize
therefore the absence condition is the negation of the above,
OptionalDataOffset >= BufferSize
This patch fixes the bug where BCFG always reports "Optional- N", even if
optional data exist.
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19715 6f19259b-4bc3-4df7-8a09-765794883524
(cherry picked from commit 898962530445979706a2c17e2f8a8c5a573e4e77)
-rw-r--r-- | ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c index ca7ecd1751..028f8523cd 100644 --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c +++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c @@ -1133,7 +1133,7 @@ BcfgDisplayDump( VariableName,
Description,
DevPathString,
- OptionalDataOffset <= BufferSize ? L'N' : L'Y'
+ OptionalDataOffset >= BufferSize ? L'N' : L'Y'
);
if (VerboseOutput) {
for (LoopVar2 = OptionalDataOffset; LoopVar2 < BufferSize; LoopVar2++){
|