]> git.proxmox.com Git - mirror_edk2.git/commit - ShellPkg/Application/Shell/ShellProtocol.c
ShellPkg: Avoid buffer out-of-bound access
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 26 Jul 2017 08:21:54 +0000 (16:21 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 28 Jul 2017 09:30:32 +0000 (17:30 +0800)
commit4f0465058b6ff9c53591ec81951f494a70bde7c1
tree2581744073e34cdaa1f64545c121093efd0176dc
parent1557f05b37f89d1f3cd41a5543a22533fc68ede6
ShellPkg: Avoid buffer out-of-bound access

PathSize is the number of bytes in PathForReturn buffer so
PathForReturn[PathSize - 1] incorrectly accesses the last
character in the buffer,
PathForReturn[PathSize / sizeof (CHAR16) - 1] should be used.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Steven Shi <steven.shi@intel.com>
ShellPkg/Application/Shell/ShellProtocol.c