ACK: [PATCH 1/3] uefibootpath: fix the URI length check

Alex Hung alex.hung at canonical.com
Thu Sep 29 23:35:41 UTC 2016


On 2016-09-29 01:27 AM, Ivan Hu wrote:
> From UEFI spec, the URI could be empty, fixing the length check.
>
> Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
> ---
>  src/uefi/uefibootpath/uefibootpath.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/uefi/uefibootpath/uefibootpath.c b/src/uefi/uefibootpath/uefibootpath.c
> index 2ab3b21..48a57c8 100644
> --- a/src/uefi/uefibootpath/uefibootpath.c
> +++ b/src/uefi/uefibootpath/uefibootpath.c
> @@ -546,10 +546,10 @@ static int uefibootpath_check_dev_path(fwts_framework *fw, fwts_uefi_dev_path *d
>  			}
>  			break;
>  		case FWTS_UEFI_URI_DEVICE_PATH_SUBTYPE:
> -			if (len <= sizeof(fwts_uefi_uri_dev_path)) {
> +			if (len < sizeof(fwts_uefi_uri_dev_path)) {
>  				fwts_failed(fw, LOG_LEVEL_MEDIUM, "UEFIURIDevPathLength",
>  					"The length of URI Device Path is %" PRIu16 " bytes "
> -					"should be larger than UEFI specification defined %" PRIu16 " bytes.",
> +					"should not be smaller than UEFI specification defined %" PRIu16 " bytes.",
>  					len,
>  					(uint16_t)sizeof(fwts_uefi_uri_dev_path));
>  				errors++;
>

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list