]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/FileHandleWrappers.c
Add code to check whether the pointer 'NewBuffer' in 'FileHandelWrappers.c' and...
[mirror_edk2.git] / ShellPkg / Application / Shell / FileHandleWrappers.c
index ef8293c1de511914e690d5b1dc3028e6a2585a9e..c67ddfc2698f72e11df9e6f10bfa677ed60c6258 100644 (file)
@@ -2,7 +2,7 @@
   EFI_FILE_PROTOCOL wrappers for other items (Like Environment Variables,\r
   StdIn, StdOut, StdErr, etc...).\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2013, Hewlett-Packard Development Company, L.P.\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -973,7 +973,7 @@ FileInterfaceEnvClose(
     Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);\r
   }\r
   \r
-  if (!EFI_ERROR(Status)) {\r
+  if (!EFI_ERROR(Status) && NewBuffer != NULL) {\r
     \r
     if (StrSize(NewBuffer) > 6)\r
     {\r