audk/ShellPkg
Ruiyu Ni 452676ffd8 Shellpkg/editor: Fix a bug that may modifies Line[-1]
The original code as below intend to set the character
before last column to CHAR_NULL.
  Line[(LastCol % (ARRAY_SIZE (Line) - 1)) - 1] = CHAR_NULL;

But when LastCol % (ARRAY_SIZE (Line) - 1)) equals to 0,
Line[-1] is modified.

We should change to code as below:
  Line[(LastCol - 1) % (ARRAY_SIZE (Line) - 1)] = CHAR_NULL;

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2017-10-26 13:04:15 +08:00
..
Application ShellPkg/Shell: Avoid reading content beyond string boundary 2017-09-21 14:06:06 +08:00
Include ShellPkg: Rename gShellCurDir to gShellCurMapping 2017-08-30 11:42:41 +08:00
Library Shellpkg/editor: Fix a bug that may modifies Line[-1] 2017-10-26 13:04:15 +08:00
ShellPkg.dec ShellPkg: Update package version to 1.01 2017-05-03 10:44:55 +08:00
ShellPkg.dsc ShellPkg: Update package version to 1.01 2017-05-03 10:44:55 +08:00