We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 772b0b1 commit aa26e97Copy full SHA for aa26e97
openssl/src/x509/mod.rs
@@ -756,12 +756,13 @@ impl X509 {
756
ffi::PEM_read_bio_X509(bio.as_ptr(), ptr::null_mut(), None, ptr::null_mut());
757
if r.is_null() {
758
let e = ErrorStack::get();
759
- let errors = e.errors();
760
- if !errors.is_empty()
761
- && errors[0].library_code() == ffi::ERR_LIB_PEM as libc::c_int
762
- && errors[0].reason_code() == ffi::PEM_R_NO_START_LINE as libc::c_int
763
- {
764
- break;
+
+ if let Some(err) = e.errors().last() {
+ if err.library_code() == ffi::ERR_LIB_PEM as libc::c_int
+ && err.reason_code() == ffi::PEM_R_NO_START_LINE as libc::c_int
+ {
+ break;
765
+ }
766
}
767
768
return Err(e);
0 commit comments