Message ID | 1475137643-28064-1-git-send-email-ivan.hu@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 29/09/16 09:27, Ivan Hu wrote: > From UEFI spec, the URI could be empty, fixing the length check. > > Signed-off-by: Ivan Hu <ivan.hu@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: Colin Ian King <colin.king@canonical.com>
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@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@canonical.com>
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++;
From UEFI spec, the URI could be empty, fixing the length check. Signed-off-by: Ivan Hu <ivan.hu@canonical.com> --- src/uefi/uefibootpath/uefibootpath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)