Revision: 19734
http://sourceforge.net/p/edk2/code/19734
Author: ydong10
Date: 2016-01-25 03:33:45 +0000 (Mon, 25 Jan 2016)
Log Message:
-----------
SourceLevelDebugPkg: DebugCommunicationLibUsb3: Update local variable type.
Update the local variable type to avoid potential data overflow.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Hao Wu <[email protected]>
Modified Paths:
--------------
trunk/edk2/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
Modified:
trunk/edk2/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
===================================================================
---
trunk/edk2/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
2016-01-22 06:30:08 UTC (rev 19733)
+++
trunk/edk2/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
2016-01-25 03:33:45 UTC (rev 19734)
@@ -1,7 +1,7 @@
/** @file
Debug Port Library implementation based on usb3 debug port.
- Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
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 text of the license may be
found at
@@ -30,18 +30,23 @@
IN UINTN BufferSize
)
{
- VOID *Buf;
+ EFI_PHYSICAL_ADDRESS TmpAddr;
+ EFI_STATUS Status;
+ VOID *Buf;
Buf = NULL;
if (gBS != NULL) {
- Buf = (VOID *)(UINTN)0xFFFFFFFF;
- gBS->AllocatePages (
- AllocateMaxAddress,
- EfiACPIMemoryNVS,
- EFI_SIZE_TO_PAGES (BufferSize),
- (EFI_PHYSICAL_ADDRESS *) &Buf
- );
+ TmpAddr = 0xFFFFFFFF;
+ Status = gBS->AllocatePages (
+ AllocateMaxAddress,
+ EfiACPIMemoryNVS,
+ EFI_SIZE_TO_PAGES (BufferSize),
+ &TmpAddr
+ );
+ if (!EFI_ERROR (Status)) {
+ Buf = (VOID *) (UINTN) TmpAddr;
+ }
}
return Buf;
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits