[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    [PATCH 1/3] uefibootpath: fix the URI length check
From:       Ivan Hu <ivan.hu () canonical ! com>
Date:       2016-09-29 8:27:21
Message-ID: 1475137643-28064-1-git-send-email-ivan.hu () canonical ! com
[Download RAW message or body]

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


-- 
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic