audk/ShellPkg/Library
Jian J Wang c3492bd9bb ShellPkg/UefiShellLevel3CommandsLib: fix string over-read
In the for-loop condition of original code, the expression

  *CurrentCommand != CHAR_NULL

is put before expression

  CurrentCommand < SortedCommandList + SortedCommandListSize/sizeof(CHAR16)

When CurrentCommand walks to the end of string buffer, one more character
over the end of string buffer will be read and then stop.

To fix this issue, just move the last expression to the first one. Because
of short-circuit evaludation of and-expression, the following one

  *CurrentCommand != CHAR_NULL

will not be evaluated if the expression before it is evaludated as FALSE.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2018-01-25 10:24:21 +08:00
..
UefiHandleParsingLib ShellPkg/dh: Fix wrong output when dumping PciRootBridgeIo 2017-11-08 13:06:16 +08:00
UefiShellBcfgCommandLib ShellPkg: Fix misuses of AllocateCopyPool 2017-11-08 17:13:04 +08:00
UefiShellCEntryLib ShellPkg: Fix typos in comments and variables 2016-11-15 11:05:34 +08:00
UefiShellCommandLib ShellPkg: Fix bug that fails to change CWD after "map -r". 2017-08-30 11:42:49 +08:00
UefiShellDebug1CommandsLib ShellPkg/HexEdit: Fix EBC build failure 2017-11-07 10:17:28 +08:00
UefiShellDriver1CommandsLib ShellPkg/disconnect: '-r' is not optional when disconnecting all 2017-09-29 15:19:10 +08:00
UefiShellInstall1CommandsLib Revert "ShellPkg : Add UEFI_APPLICATION module type to UefiShellInstall1CommandsLib.inf" 2016-01-06 16:23:20 +00:00
UefiShellLevel1CommandsLib ShellPkg: Update sources to include MdePkg protocol definitions 2016-10-19 10:26:16 +08:00
UefiShellLevel2CommandsLib ShellPkg/UefiShellLevel2CommandsLib: add missing EFIAPI call conv spec 2018-01-08 23:15:02 +01:00
UefiShellLevel3CommandsLib ShellPkg/UefiShellLevel3CommandsLib: fix string over-read 2018-01-25 10:24:21 +08:00
UefiShellLib ShellPkg/ShellLib: Fix dynamic command fails to start during boot 2017-11-29 10:31:54 +08:00
UefiShellNetwork1CommandsLib ShellPkg: Update Api from NetLibDetectMedia to NetLibDetectMediaWaitTimeout. 2017-12-18 16:38:24 +08:00
UefiShellNetwork2CommandsLib ShellPkg: Fix a build error in Ping6 shell command. 2017-12-18 17:52:02 +08:00