From: vanjeff Date: Sat, 8 Jul 2006 15:21:04 +0000 (+0000) Subject: In AsciiStrncmp(), if length=0, should return 0 X-Git-Tag: edk2-stable201903~25009 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=03e772c322f7364c4721e1bb4eb041ddb0d319e9 In AsciiStrncmp(), if length=0, should return 0 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@840 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index 80223c6732..a59a9d08cb 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -713,6 +713,10 @@ AsciiStrnCmp ( IN UINTN Length ) { + if (Length == 0) { + return 0; + } + // // ASSERT both strings are less long than PcdMaximumAsciiStringLength //