Skip to content

Commit 6e6ed03

Browse files
authored
x509-cert: Fix underflow on empty input in Certificate::load_pem_chain (#1965)
1 parent ee30600 commit 6e6ed03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x509-cert/src/certificate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl<P: Profile> CertificateInner<P> {
411411
}
412412
}
413413

414-
while position < input.len() - 1 {
414+
while position + 1 < input.len() {
415415
let rest = &input[position..];
416416
let end_pos = find_boundary(rest, end_boundary)
417417
.ok_or(pem::Error::PostEncapsulationBoundary)?

0 commit comments

Comments
 (0)