efi_loader: fixe unreachable statement in efi_sigstore_parse_siglist
PATCH 1/1 efi_loader: fixe unreachable statement in efi_sigstore_parse_siglist
"if (left < esl->signature_size)" is not reachable in a while loop. But it is still valuable in case that a given signature database is somehow corrupted. So fix the while loop condition.
--- lib/efi_loader/efi_signature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/efi_loader/efi_signature.c +1 -1
@@ -668,7 +668,7 @@ efi_sigstore_parse_siglist(struct efi_signature_list *esl) esd = (struct efi_signature_data *) ((u8 *)esl +sizeof (*esl) + esl->signature_header_size); -while ((left >0 ) && left >= esl->signature_size) { +while (left >0 ) {/* Signature must exist if there is remaining data. */ if (left < esl->signature_size) {debug ("Certificate is too small\n" );
Signature · 1 line
2.25.2
PATCH 1/1 efi_loader: fixe unreachable statement in efi_sigstore_parse_siglist
Quoted 6 lines · AKASHI Takahiro
"if (left <
esl->signature_size)" is not reachable in a while loop. But it is still valuable in case that a given signature database is somehow corrupted. So fix the while loop condition.Signed-off-by AKASHI Takahiro <[email protected]>Reported-by Heinrich Schuchardt <[email protected]>
Quoted 18 lines
--- lib/efi_loader/efi_signature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/efi_loader/efi_signature.c +1
-1@@ -668,7 +668,7 @@ efi_sigstore_parse_siglist(struct efi_signature_list *esl) esd = (struct efi_signature_data *) ((u8 *)esl +sizeof (*esl) + esl->signature_header_size); -while ((left >0 ) && left >= esl->signature_size) { +while (left >0 ) {/* Signature must exist if there is remaining data. */ if (left < esl->signature_size) {debug ("Certificate is too small\n" );
PATCH 1/1 efi_loader: fixe unreachable statement in efi_sigstore_parse_siglist
Quoted 9 lines · Heinrich Schuchardt
Quoted 6 lines · AKASHI Takahiro
"if (left <
esl->signature_size)" is not reachable in a while loop. But it is still valuable in case that a given signature database is somehow corrupted. So fix the while loop condition.Signed-off-by AKASHI Takahiro <[email protected]>Reported-by Heinrich Schuchardt <[email protected]>Reviewed-by Heinrich Schuchardt <[email protected]>
Patch is merged. Thanks Heinrich