mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
2d49938845
commit
d727614c91
|
@ -2828,7 +2828,7 @@ InternalShellPrintWorker(
|
|||
// update the attribute
|
||||
//
|
||||
if (ResumeLocation != NULL) {
|
||||
if (*(ResumeLocation-1) == L'^') {
|
||||
if ((ResumeLocation != mPostReplaceFormat2) && (*(ResumeLocation-1) == L'^')) {
|
||||
//
|
||||
// Move cursor back 1 position to overwrite the ^
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue