audk/ShellPkg/Library/UefiShellLevel3CommandsLib
Zhichao Gao ef2360569d ShellPkg/Type.c: Add value check before (LoopVar - 1)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1964

If the file begin with single line Feed ('\n'), then
"AsciiChar == '\n' && ((CHAR8*)Buffer)[LoopVar-1] != '\r'"
would cause a underflow. Add this condition
"(AsciiChar == '\n' && LoopVar == 0)" before it to make sure
(LoopVar - 1) would never encounter a underflow.

Same change in Unicode section.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Andrew Fish <afish@apple.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
2019-07-19 08:32:11 -07:00
..
Alias.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Cls.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Echo.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
GetMtc.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Help.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Pause.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Touch.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Type.c ShellPkg/Type.c: Add value check before (LoopVar - 1) 2019-07-19 08:32:11 -07:00
UefiShellLevel3CommandsLib.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
UefiShellLevel3CommandsLib.h ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
UefiShellLevel3CommandsLib.inf ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
UefiShellLevel3CommandsLib.uni ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00
Ver.c ShellPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:25 -07:00