diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-08 02:35:56 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-08 02:35:56 +0000 |
commit | e285199897e538523f762cb5b3900e81f872035a (patch) | |
tree | aad7875d4dfb9f1705796b9c405c4f5549df18e1 /MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c | |
parent | 33338afebd3004e24d642e6dd7d053cda83990f1 (diff) | |
download | edk2-platforms-e285199897e538523f762cb5b3900e81f872035a.tar.xz |
refine the code and add more security check.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9691 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c')
-rw-r--r-- | MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c b/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c index 8d72f585d0..54d317416d 100644 --- a/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c +++ b/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c @@ -1,7 +1,7 @@ /** @file
HII Config Access protocol implementation of VLAN configuration module.
-Copyright (c) 2009, Intel Corporation.<BR>
+Copyright (c) 2009 - 2010, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions
of the BSD License which accompanies this distribution. The full
@@ -238,6 +238,7 @@ VlanCallback ( //
// Remove VLAN
//
+ ASSERT (PrivateData->NumberOfVlan <= MAX_VLAN_NUMBER);
for (Index = 0; Index < PrivateData->NumberOfVlan; Index++) {
if (Configuration->VlanList[Index] != 0) {
//
@@ -421,7 +422,7 @@ InstallVlanConfigForm ( EFI_STATUS Status;
EFI_HII_HANDLE HiiHandle;
EFI_HANDLE DriverHandle;
- CHAR16 Str[40];
+ CHAR16 Str[26 + sizeof (EFI_MAC_ADDRESS) * 2 + 1];
CHAR16 *MacString;
EFI_DEVICE_PATH_PROTOCOL *ChildDevicePath;
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
@@ -479,6 +480,7 @@ InstallVlanConfigForm ( PrivateData->MacString = MacString;
StrCpy (Str, L"VLAN Configuration (MAC:");
+ ASSERT (StrLen (MacString) <= (sizeof (EFI_MAC_ADDRESS) * 2));
StrCat (Str, MacString);
StrCat (Str, L")");
HiiSetString (
|