diff options
author | sfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-12-24 02:52:27 +0000 |
---|---|---|
committer | sfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-12-24 02:52:27 +0000 |
commit | f8c075d112ebb41f2dfc693426c33a9ed2e9bb22 (patch) | |
tree | 1611b9ccd35e18cd08fbe73f6db344ce34f7ea92 | |
parent | 5b484a25f744b123093a49bbb0188b78e7c7d99d (diff) | |
download | edk2-platforms-f8c075d112ebb41f2dfc693426c33a9ed2e9bb22.tar.xz |
1. Fix buffer overflow bugs in SNP, MNP and IP6 driver.
2. Fix GCC build fail issue in DxeNetLib.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Ouyang Qian <qian.ouyang@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14017 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 1 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/MnpDxe/ComponentName.c | 4 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c | 6 | ||||
-rw-r--r-- | NetworkPkg/Ip6Dxe/ComponentName.c | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index 50e40c8eba..61e4c8c9d1 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -1154,6 +1154,7 @@ NetDestroyLinkList ( **/
BOOLEAN
+EFIAPI
NetIsInHandleBuffer (
IN EFI_HANDLE Handle,
IN UINTN NumberOfChildren,
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/ComponentName.c b/MdeModulePkg/Universal/Network/MnpDxe/ComponentName.c index 9e66dc254b..25a7f88482 100644 --- a/MdeModulePkg/Universal/Network/MnpDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Network/MnpDxe/ComponentName.c @@ -148,7 +148,7 @@ UpdateName ( for (Index = 0; Index < SnpModeData.HwAddressSize; Index++) {
OffSet += UnicodeSPrint (
HandleName + OffSet,
- sizeof (HandleName) - OffSet,
+ sizeof (HandleName) - OffSet * sizeof (CHAR16),
L"%02X-",
SnpModeData.CurrentAddress.Addr[Index]
);
@@ -162,7 +162,7 @@ UpdateName ( //
OffSet += UnicodeSPrint (
HandleName + OffSet,
- sizeof (HandleName) - OffSet,
+ sizeof (HandleName) - OffSet * sizeof (CHAR16),
L", ProtocolType=0x%X, VlanId=%d)",
MnpConfigData.ProtocolTypeFilter,
Instance->MnpServiceData->VlanId
diff --git a/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c b/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c index ef499d18cf..0b12359f14 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c @@ -266,7 +266,7 @@ UpdateName ( for (Index = 0; Index < Snp->Mode->HwAddressSize; Index++) {
OffSet += UnicodeSPrint (
HandleName + OffSet,
- sizeof (HandleName) - OffSet,
+ sizeof (HandleName) - OffSet * sizeof (CHAR16),
L"%02X-",
Snp->Mode->CurrentAddress.Addr[Index]
);
@@ -276,8 +276,8 @@ UpdateName ( //
OffSet--;
OffSet += UnicodeSPrint (
- HandleName,
- sizeof (HandleName),
+ HandleName + OffSet,
+ sizeof (HandleName) - OffSet * sizeof (CHAR16),
L")"
);
if (gSimpleNetworkControllerNameTable != NULL) {
diff --git a/NetworkPkg/Ip6Dxe/ComponentName.c b/NetworkPkg/Ip6Dxe/ComponentName.c index dc164269a8..75a1562ca0 100644 --- a/NetworkPkg/Ip6Dxe/ComponentName.c +++ b/NetworkPkg/Ip6Dxe/ComponentName.c @@ -280,7 +280,7 @@ UpdateName ( }
UnicodeSPrint (
HandleName + Offset,
- sizeof(HandleName) - Offset,
+ sizeof(HandleName) - Offset * sizeof (CHAR16),
L"DestinationAddress=%s)",
Address
);
|