Add the missing check for NULL pointer before use it.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10116 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -109,6 +109,8 @@ NewStrCat (
|
||||
hit, then 2 Unicode character will consume an output storage
|
||||
space with size of CHAR16 till a NARROW_CHAR is hit.
|
||||
|
||||
If String is NULL, then ASSERT ().
|
||||
|
||||
@param String The input string to be counted.
|
||||
|
||||
@return Storage space for the input string.
|
||||
@@ -123,6 +125,11 @@ GetStringWidth (
|
||||
UINTN Count;
|
||||
UINTN IncrementValue;
|
||||
|
||||
ASSERT (String != NULL);
|
||||
if (String == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Index = 0;
|
||||
Count = 0;
|
||||
IncrementValue = 1;
|
||||
|
Reference in New Issue
Block a user