diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-11-29 13:19:50 +0100 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-12-05 09:04:54 +0100 |
commit | c0b7379a31091f9640f7d6592222b286669ef510 (patch) | |
tree | a92bc1c4d2bfb5841e292597f403b90fa3763bf0 /BaseTools/Source/C | |
parent | 4d393eb876297d1d73a4f2cc16ddb2d5d74e1c11 (diff) | |
download | edk2-c0b7379a31091f9640f7d6592222b286669ef510.tar.gz edk2-c0b7379a31091f9640f7d6592222b286669ef510.tar.bz2 edk2-c0b7379a31091f9640f7d6592222b286669ef510.zip |
BaseTools/DevicePath: use MAX_UINT32 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.
4 GiB 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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r-- | BaseTools/Source/C/DevicePath/DevicePathUtilities.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c index d4ec2742b7..f8a41ff97d 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_UINT32;
}
//
@@ -78,7 +78,7 @@ IsDevicePathValid ( return FALSE;
}
- if (NodeLength > MAX_UINTN - Size) {
+ if (NodeLength > MAX_UINT32 - Size) {
return FALSE;
}
Size += NodeLength;
|