diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-11-17 14:59:54 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2017-01-12 21:26:26 +0800 |
commit | fbda8a344bafff20d31ceb649a220e4aaa465468 (patch) | |
tree | 0fcf00a336cc5f422d6e008311a3f7f234fa2759 /MdePkg/Library | |
parent | 12233c19177d3971b657200778b681c6132e598b (diff) | |
download | edk2-platforms-fbda8a344bafff20d31ceb649a220e4aaa465468.tar.xz |
MdePkg/UefiFileHandleLib: Refine the check for valid Ascii character
The commit will check if bit 7 is set of an Ascii character to judge its
validity.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg/Library')
-rw-r--r-- | MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c index daed0f4870..57aad77bc1 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;
}
|