The commit will check if bit 7 is set of an Ascii character to judge its validity.
Cc: Liming Gao <[email protected]> Cc: Michael Kinney <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <[email protected]> --- MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c index daed0f4..57aad77 100644 --- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c +++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c @@ -1,7 +1,7 @@ /** @file Provides interface to EFI_FILE_HANDLE functionality. - Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved. <BR> + Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved. <BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1138,7 +1138,7 @@ FileHandleWriteLine( } UnicodeStrToAsciiStrS (Buffer, AsciiBuffer, Size); for (Index = 0; Index < Size; Index++) { - if (!((AsciiBuffer[Index] >= 0) && (AsciiBuffer[Index] < 128))){ + if ((AsciiBuffer[Index] & BIT7) != 0) { FreePool(AsciiBuffer); return EFI_INVALID_PARAMETER; } -- 1.9.5.msysgit.0 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

