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

Ivan Hu ivan.hu at canonical.com
Thu Sep 29 08:27:21 UTC 2016


>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++;
-- 
1.9.1




More information about the fwts-devel mailing list