diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2014-12-23 09:56:33 +0000 |
---|---|---|
committer | niruiyu <niruiyu@Edk2> | 2014-12-23 09:56:33 +0000 |
commit | 0b13fe741b7221514da510c165a55e47a3d377b2 (patch) | |
tree | b1454d8382be104fefdbe2e5fc70c2a15e1ecd5f /MdePkg/Library | |
parent | e4b0415d59d00eacc0ce4755ad6aaab80b16075c (diff) | |
download | edk2-platforms-0b13fe741b7221514da510c165a55e47a3d377b2.tar.xz |
Do not assert when the device path node length is invalid.
Because IsDevicePathValid() calls this API we should leave the device path validation in the caller.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16555 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library')
-rw-r--r-- | MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c index b73bcce07c..5cc4b35fe4 100644 --- a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c +++ b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c @@ -2,7 +2,7 @@ Library instance that implement UEFI Device Path Library class based on protocol
gEfiDevicePathUtilitiesProtocolGuid.
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, 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
@@ -195,12 +195,8 @@ DevicePathNodeLength ( IN CONST VOID *Node
)
{
- UINTN Length;
-
ASSERT (Node != NULL);
- Length = ReadUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Length[0]);
- ASSERT (Length >= sizeof (EFI_DEVICE_PATH_PROTOCOL));
- return Length;
+ return ReadUnaligned16 ((UINT16 *)&((EFI_DEVICE_PATH_PROTOCOL *)(Node))->Length[0]);
}
/**
@@ -567,8 +563,7 @@ GetNextDevicePathInstance ( If there is not enough memory to allocate space for the new device path, then
NULL is returned.
The memory is allocated from EFI boot services memory. It is the responsibility
- of the caller to
- free the memory allocated.
+ of the caller to free the memory allocated.
@param NodeType The device node type for the new device node.
@param NodeSubType The device node sub-type for the new device node.
|