summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/String.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseLib/String.c')
-rw-r--r--MdePkg/Library/BaseLib/String.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
index 227a0dc..9505c5b 100644
--- a/MdePkg/Library/BaseLib/String.c
+++ b/MdePkg/Library/BaseLib/String.c
@@ -1,7 +1,7 @@
/** @file
Unicode and ASCII string primatives.
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, 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
@@ -1040,7 +1040,7 @@ UnicodeStrToAsciiStr (
//
// Source and Destination should not overlap
//
- ASSERT ((UINTN) ((CHAR16 *) Destination - Source) > StrLen (Source));
+ ASSERT ((UINTN) (Destination - (CHAR8 *) Source) >= StrSize (Source));
ASSERT ((UINTN) ((CHAR8 *) Source - Destination) > StrLen (Source));
@@ -2008,9 +2008,9 @@ AsciiStrToUnicodeStr (
// Source and Destination should not overlap
//
ASSERT ((UINTN) ((CHAR8 *) Destination - Source) > AsciiStrLen (Source));
- ASSERT ((UINTN) (Source - (CHAR8 *) Destination) > (AsciiStrLen (Source) * sizeof (CHAR16)));
+ ASSERT ((UINTN) (Source - (CHAR8 *) Destination) >= (AsciiStrSize (Source) * sizeof (CHAR16)));
+
-
ReturnValue = Destination;
while (*Source != '\0') {
*(Destination++) = (CHAR16) *(Source++);