public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Zhang, Shenglei" <shenglei.zhang@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH 2/2] MdePkg/UefiDevicePathLib: Add a checking step
Date: Tue, 11 Dec 2018 06:44:19 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E389E1E@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20181211063041.25108-3-shenglei.zhang@intel.com>

Shenglei:
  Please update IsDevicePathValid() API description in MdePkg\Include\Library\DevicePathLib.h, and also remove ASSERT (DevicePath != NULL); in function implementation.

Thanks
Liming
> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Tuesday, December 11, 2018 2:31 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [PATCH 2/2] MdePkg/UefiDevicePathLib: Add a checking step
> 
> Add a checking step in DevicePathUtilities.c to verify DevicePath.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  .../Library/UefiDevicePathLib/DevicePathUtilities.c  | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c
> index 665e5a4adc..f29e1e22f6 100644
> --- a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c
> +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c
> @@ -59,6 +59,18 @@ IsDevicePathValid (
>    UINTN Size;
>    UINTN NodeLength;
> 
> +/**
> +  NULL device path is also invalid path.
> +
> +  IsDevicePathValid() should return FALSE or TRUE, and not ASSERT().
> +
> +  This change needs to update IsDevicePathValid() API definition and implementation both.
> +
> +**/
> +  if (DevicePath == NULL || (MaxSize > 0 && MaxSize < END_DEVICE_PATH_LENGTH)) {
> +    return FALSE;
> +  }
> +
>    ASSERT (DevicePath != NULL);
> 
>    if (MaxSize == 0) {
> --
> 2.18.0.windows.1



      reply	other threads:[~2018-12-11  6:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11  6:30 [PATCH 0/2] Add a checking step in MdePkg and Basetools Shenglei Zhang
2018-12-11  6:30 ` [PATCH 1/2] BaseTools/DevicePath: Add a checking step Shenglei Zhang
2018-12-11  6:30 ` [PATCH 2/2] MdePkg/UefiDevicePathLib: " Shenglei Zhang
2018-12-11  6:44   ` Gao, Liming [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E389E1E@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox