From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Laszlo Ersek <lersek@redhat.com>, "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH 4/6] BaseTools/DevicePath: use MAX_UINT16 as default device path max size
Date: Thu, 29 Nov 2018 15:18:37 +0000 [thread overview]
Message-ID: <CB6E33457884FA40993F35157061515CA7160A47@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <20181129123129.25095-5-ard.biesheuvel@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ard Biesheuvel
> Sent: Thursday, November 29, 2018 4:31 AM
> To: edk2-devel@lists.01.org
> Cc: Laszlo Ersek <lersek@redhat.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [PATCH 4/6] BaseTools/DevicePath: use MAX_UINT16 as
> default device path max size
>
> Replace the default size limit of IsDevicePathValid() with a value
> that does not depend on the native word size of the build host.
>
> 64 KB seems sufficient as the upper bound of a device path handled
> by UEFI.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> BaseTools/Source/C/DevicePath/DevicePathUtilities.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> index d4ec2742b7c8..ba7f83e53070 100644
> --- a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> +++ b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> @@ -62,7 +62,7 @@ IsDevicePathValid (
> ASSERT (DevicePath != NULL);
>
> if (MaxSize == 0) {
> - MaxSize = MAX_UINTN;
> + MaxSize = MAX_UINT16;
> }
>
> //
> @@ -78,7 +78,7 @@ IsDevicePathValid (
> return FALSE;
> }
>
> - if (NodeLength > MAX_UINTN - Size) {
> + if (NodeLength > MAX_UINT16 - Size) {
> return FALSE;
> }
> Size += NodeLength;
> --
> 2.19.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
next prev parent reply other threads:[~2018-11-29 15:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 12:31 [PATCH 0/6] BaseTools: get rid of MAX_UINTN Ard Biesheuvel
2018-11-29 12:31 ` [PATCH 1/6] BaseTools/CommonLib: avoid using 'native' word size in IP address handling Ard Biesheuvel
2018-11-29 15:11 ` Gao, Liming
2018-11-29 15:13 ` Ard Biesheuvel
2018-11-29 15:15 ` Gao, Liming
2018-11-29 15:18 ` Ard Biesheuvel
2018-11-30 15:47 ` Gao, Liming
2018-11-29 12:31 ` [PATCH 2/6] BaseTools/CommonLib: use explicit 64-bit type in Strtoi() Ard Biesheuvel
2018-11-29 15:17 ` Carsey, Jaben
2018-11-29 12:31 ` [PATCH 3/6] BaseTools/DevicePath: use explicit 64-bit number parsing routines Ard Biesheuvel
2018-11-29 15:17 ` Carsey, Jaben
2018-11-29 12:31 ` [PATCH 4/6] BaseTools/DevicePath: use MAX_UINT16 as default device path max size Ard Biesheuvel
2018-11-29 15:18 ` Carsey, Jaben [this message]
2018-11-29 12:31 ` [PATCH 5/6] BaseTools/CommonLib: get rid of 'native' type string parsing routines Ard Biesheuvel
2018-11-29 12:31 ` [PATCH 6/6] BaseTools/CommonLib: drop definition of MAX_UINTN Ard Biesheuvel
2018-11-29 15:18 ` Carsey, Jaben
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=CB6E33457884FA40993F35157061515CA7160A47@FMSMSX103.amr.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