]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c
MdePkg/BaseSafeIntLib: fix undefined behavior in SafeInt64Add()
[mirror_edk2.git] / MdePkg / Library / UefiFileHandleLib / UefiFileHandleLib.c
index daed0f48700a4618ee0a44d7ec2735e08bb57295..57aad77bc13542ce7828853a1500f75e79a43ab3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides interface to EFI_FILE_HANDLE functionality.\r
 \r
-  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved. <BR>\r
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -1138,7 +1138,7 @@ FileHandleWriteLine(
     }\r
     UnicodeStrToAsciiStrS (Buffer, AsciiBuffer, Size);\r
     for (Index = 0; Index < Size; Index++) {\r
-      if (!((AsciiBuffer[Index] >= 0) && (AsciiBuffer[Index] < 128))){\r
+      if ((AsciiBuffer[Index] & BIT7) != 0) {\r
         FreePool(AsciiBuffer);\r
         return EFI_INVALID_PARAMETER;\r
       }\r