Add more checking to avoid the buffer overflow.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8626 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -41,6 +41,10 @@ IsNvNeed (
|
||||
Ptr++;
|
||||
}
|
||||
|
||||
if ((((UINTN)Ptr - (UINTN)ConVarName) / sizeof (CHAR16)) <= 3) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) {
|
||||
return FALSE;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user