From 859a04b7ff10d0e4ff6281503643922c0eb35cf3 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 18 Mar 2015 20:02:01 -0400 Subject: [PATCH] Fix missing return checks in v3_cpols.c Fixed assorted missing return value checks in v3_cpols.c (Imported from upstream's c5f2b5336ab72e40ab91e2ca85639f51fa3178c6.) Change-Id: I95e4157fc689201ca32e1c8e51d04801ba478685 Reviewed-on: https://boringssl-review.googlesource.com/4008 Reviewed-by: Adam Langley --- crypto/x509v3/v3_cpols.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/x509v3/v3_cpols.c b/crypto/x509v3/v3_cpols.c index d5a8c3ca..64f97433 100644 --- a/crypto/x509v3/v3_cpols.c +++ b/crypto/x509v3/v3_cpols.c @@ -228,7 +228,14 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx, goto merr; /* TODO(fork): const correctness */ qual->pqualid = (ASN1_OBJECT*) OBJ_nid2obj(NID_id_qt_cps); + if (qual->pqualid == NULL) { + OPENSSL_PUT_ERROR(X509V3, policy_section, ERR_R_INTERNAL_ERROR); + goto err; + } qual->d.cpsuri = M_ASN1_IA5STRING_new(); + if (qual->d.cpsuri == NULL) { + goto err; + } if(!ASN1_STRING_set(qual->d.cpsuri, cnf->value, strlen(cnf->value))) goto merr; } else if(!name_cmp(cnf->name, "userNotice")) {