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>
ASSERT (DevicePath != NULL);\r
\r
if (MaxSize == 0) {\r
ASSERT (DevicePath != NULL);\r
\r
if (MaxSize == 0) {\r
+ MaxSize = MAX_UINT32;\r
- if (NodeLength > MAX_UINTN - Size) {\r
+ if (NodeLength > MAX_UINT32 - Size) {\r
return FALSE;\r
}\r
Size += NodeLength;\r
return FALSE;\r
}\r
Size += NodeLength;\r