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:
klu2 2009-06-23 08:42:38 +00:00
parent 841014ba97
commit f0a3b1a221
1 changed files with 4 additions and 0 deletions

View File

@ -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 {