From d00719485f6d2be3b84d076a1bd3b7f96000a57f Mon Sep 17 00:00:00 2001 From: Enze Zhu Date: Mon, 26 Oct 2020 16:39:37 +0800 Subject: 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 Reviewed-by: Liming Gao Reviewed-by: Zhichao Gao --- ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ShellPkg') 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; -- cgit v1.2.3