Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: runtime/bin/secure_socket_boringssl.cc

Issue 2211453002: Clear the error bit after reading the default trusted certs (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix date Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/io/issue_26954_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/secure_socket_boringssl.cc
diff --git a/runtime/bin/secure_socket_boringssl.cc b/runtime/bin/secure_socket_boringssl.cc
index 0fd1c9e664fea51d77aa226c76aa2ee89ff75c48..def3aae0b8e3875efc66891a7f3769fa299d46bc 100644
--- a/runtime/bin/secure_socket_boringssl.cc
+++ b/runtime/bin/secure_socket_boringssl.cc
@@ -800,10 +800,14 @@ void FUNCTION_NAME(SecurityContext_TrustBuiltinRoots)(
// PEM_read_bio_X509 reads PEM-encoded certificates from a bio (in our case,
// backed by a memory buffer), and returns X509 objects, one by one.
// When the end of the bio is reached, it returns null.
- while ((root_cert = PEM_read_bio_X509(roots_bio, NULL, NULL, NULL))) {
+ while ((root_cert = PEM_read_bio_X509(roots_bio, NULL, NULL, NULL)) != NULL) {
X509_STORE_add_cert(store, root_cert);
}
BIO_free(roots_bio);
+ // If there is an error here, it must be the error indicating that we are done
+ // reading PEM certificates.
+ ASSERT((ERR_peek_error() == 0) || NoPEMStartLine());
+ ERR_clear_error();
#endif // defined(TARGET_OS_ANDROID)
}
« no previous file with comments | « no previous file | tests/standalone/io/issue_26954_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698