/*
- * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
*/
static X509_CRL *CRL_from_strings(const char **pem)
{
+ X509_CRL *crl;
char *p;
BIO *b = glue2bio(pem, &p);
- X509_CRL *crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);
+
+ if (b == NULL) {
+ OPENSSL_free(p);
+ return NULL;
+ }
+
+ crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);
OPENSSL_free(p);
BIO_free(b);
*/
static X509 *X509_from_strings(const char **pem)
{
+ X509 *x;
char *p;
BIO *b = glue2bio(pem, &p);
- X509 *x = PEM_read_bio_X509(b, NULL, NULL, NULL);
+
+ if (b == NULL) {
+ OPENSSL_free(p);
+ return NULL;
+ }
+
+ x = PEM_read_bio_X509(b, NULL, NULL, NULL);
OPENSSL_free(p);
BIO_free(b);
char *p;
BIO *b = glue2bio(kRevokedCRL, &p);
+ if (b == NULL) {
+ OPENSSL_free(p);
+ X509_CRL_free(reused_crl);
+ return 0;
+ }
+
reused_crl = PEM_read_bio_X509_CRL(b, &reused_crl, NULL, NULL);
OPENSSL_free(p);