Refine code to make it more safely.
Signed-off-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13712 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -59,7 +59,7 @@ GetAttrType (
|
|||||||
RetString = StrnCatGrow(&RetString, &BufLen, L"Invalid", 0);
|
RetString = StrnCatGrow(&RetString, &BufLen, L"Invalid", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RetString[0] == L'+') {
|
if ((RetString != NULL) && (RetString[0] == L'+')) {
|
||||||
CopyMem(RetString, RetString + 1, StrSize(RetString + 1));
|
CopyMem(RetString, RetString + 1, StrSize(RetString + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user