ShellPkg:Fix bug in FileBuffer.c

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

In the function FileBufferCutLine(),set the CutLine pointer to NULL,
The function header specifies that the pointer is valid on a successful
or failed return code.

Signed-off-by: Enze Zhu <zhuenze@byosoft.com.cn>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
This commit is contained in:
Enze Zhu 2020-10-26 16:39:37 +08:00 committed by mergify[bot]
parent 09af9bd9be
commit d00719485f
1 changed files with 2 additions and 0 deletions

View File

@ -2767,6 +2767,8 @@ FileBufferCutLine (
UINTN Row;
UINTN Col;
*CutLine = NULL;
if (FileBuffer.ReadOnly) {
StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
return EFI_SUCCESS;