Attached is the report for Coverity issues identified in ShellPkg based
on edk2-stable202205.

Cc: Srinivasan Mani <[email protected]>
Cc: Sundaresan Selvaraj <[email protected]>
Cc: Arun k <[email protected]>
Signed-off-by: Kalaivani P <[email protected]>
---
 ShellPkg/Application/Shell/ShellProtocol.c   |  5 ++++-
 ShellPkg/Library/UefiShellLib/UefiShellLib.c | 11 ++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ShellPkg/Application/Shell/ShellProtocol.c 
b/ShellPkg/Application/Shell/ShellProtocol.c
index e6d20ab164..e4ac7f9554 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -4,6 +4,7 @@


   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>

   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>

+  Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>

   Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -2524,7 +2525,9 @@ ShellSearchHandle (
               EfiShellClose (ShellInfoNode->Handle);

               ShellInfoNode->Handle = NULL;

             }

-          } else if (!EFI_ERROR (Status)) {

+

+           } else if (!EFI_ERROR (Status) && (ShellInfoNode->FullName != 
NULL)) {

+

             //

             // should be a file

             //

diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c 
b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index a72767bd86..fd76da8ea5 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -3,6 +3,7 @@


   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>

   Copyright 2016-2018 Dell Technologies.<BR>

+  Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>

   Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>

   SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -1761,6 +1762,9 @@ ShellCloseFileMetaArg (
   // ASSERT that ListHead is not NULL

   //

   ASSERT (ListHead != NULL);

+  if (ListHead == NULL) {

+    return (SHELL_INVALID_PARAMETER);

+  }



   //

   // Check for UEFI Shell 2.0 protocols

@@ -4377,9 +4381,10 @@ ShellFileHandleReadLine (
     return (EFI_INVALID_PARAMETER);

   }



-  if (Buffer == NULL) {

-    ASSERT (*Size == 0);

-  } else {

+  if ((Buffer == NULL) && (*Size != 0)) {

+    return EFI_INVALID_PARAMETER;

+  }

+  else {

     *Buffer = CHAR_NULL;

   }



--
2.36.0.windows.1
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97783): https://edk2.groups.io/g/devel/message/97783
Mute This Topic: https://groups.io/mt/95917858/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to