Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Do not assert when the device path node length is invalid.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Liming Gao <[email protected]>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16555 6f19259b-4bc3-4df7-8a09-765794883524
  • Loading branch information
niruiyu authored and niruiyu committed Dec 23, 2014
1 parent e4b0415 commit 0b13fe7
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]);
}

/**
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0b13fe7

Please sign in to comment.