summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorEnze Zhu <zhuenze@byosoft.com.cn>2020-10-26 16:39:37 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-11-06 01:34:11 +0000
commitd00719485f6d2be3b84d076a1bd3b7f96000a57f (patch)
treed414d868f25edb0a1a3857ea4a2fd9d8498e2798 /ShellPkg
parent09af9bd9be2d3e31bba979f8cf6446017b0b863e (diff)
downloadedk2-d00719485f6d2be3b84d076a1bd3b7f96000a57f.tar.gz
edk2-d00719485f6d2be3b84d076a1bd3b7f96000a57f.tar.bz2
edk2-d00719485f6d2be3b84d076a1bd3b7f96000a57f.zip
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>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
index 5659ec9810..925d910ae2 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
@@ -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;