]> git.proxmox.com Git - mirror_edk2.git/commit
ShellPkg/UefiShellLib: Avoid reading undefined content before string
authorHao Wu <hao.a.wu@intel.com>
Tue, 23 May 2017 01:47:26 +0000 (09:47 +0800)
committerHao Wu <hao.a.wu@intel.com>
Wed, 24 May 2017 05:17:51 +0000 (13:17 +0800)
commitd727614c913449a59e8333c4d75cff4ebf1f9779
treef45a699d21e8ce4b4e077f9baa61e89e52989d5a
parent2d499388452cf8215265a0757395e7dbcdb32ea8
ShellPkg/UefiShellLib: Avoid reading undefined content before string

https://bugzilla.tianocore.org/show_bug.cgi?id=566

In function InternalShellPrintWorker(), if the string in variable
'mPostReplaceFormat2' starts with character L'%', the following
expression:

*(ResumeLocation-1) == L'^' at line 2831

will read an undefined value before the starting of string
'mPostReplaceFormat2'.

This commit adds additional logic to avoid reading undefined content.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiShellLib/UefiShellLib.c