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 <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.wu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19734 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2016-01-25 03:33:45 +00:00 committed by ydong10
parent 0179180d6d
commit 95055567a6
1 changed files with 14 additions and 9 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Debug Port Library implementation based on usb3 debug port. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -30,18 +30,23 @@ AllocateAlignBuffer (
IN UINTN BufferSize IN UINTN BufferSize
) )
{ {
EFI_PHYSICAL_ADDRESS TmpAddr;
EFI_STATUS Status;
VOID *Buf; VOID *Buf;
Buf = NULL; Buf = NULL;
if (gBS != NULL) { if (gBS != NULL) {
Buf = (VOID *)(UINTN)0xFFFFFFFF; TmpAddr = 0xFFFFFFFF;
gBS->AllocatePages ( Status = gBS->AllocatePages (
AllocateMaxAddress, AllocateMaxAddress,
EfiACPIMemoryNVS, EfiACPIMemoryNVS,
EFI_SIZE_TO_PAGES (BufferSize), EFI_SIZE_TO_PAGES (BufferSize),
(EFI_PHYSICAL_ADDRESS *) &Buf &TmpAddr
); );
if (!EFI_ERROR (Status)) {
Buf = (VOID *) (UINTN) TmpAddr;
}
} }
return Buf; return Buf;