summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-23 08:42:38 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-06-23 08:42:38 +0000
commitf0a3b1a221ad8a678de18fb8ad9e2a6ba8112093 (patch)
treee2b9138882973a3850951122e6131972f6c73a24 /IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
parent841014ba97539efa5f69c5ffd874ffc55e426023 (diff)
downloadedk2-platforms-f0a3b1a221ad8a678de18fb8ad9e2a6ba8112093.tar.xz
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
Diffstat (limited to 'IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c')
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
index bc8de582f6..0eadec9fe7 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
@@ -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 {