1) Fix the bug the assert conditions. || should be &&.
2) Add in code path and check-for-null-pointer to do error handling.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7308 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2009-01-20 01:52:02 +00:00
parent 5a829f5688
commit 96ff65a1fb
3 changed files with 6 additions and 4 deletions

View File

@ -124,7 +124,7 @@ ConvertToUnicodeText (
ASSERT (StringSrc != NULL && BufferSize != NULL);
StringSize = AsciiStrSize (StringSrc) * 2;
if (*BufferSize < StringSize) {
if (*BufferSize < StringSize || StringDest == NULL) {
*BufferSize = StringSize;
return EFI_BUFFER_TOO_SMALL;
}