Fix missing return checks in v3_cpols.c
Fixed assorted missing return value checks in c3_cpols.c
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit c5f2b5336a
)
This commit is contained in:
parent
2407241fb2
commit
f06249f112
@ -230,8 +230,12 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
|
|||||||
goto merr;
|
goto merr;
|
||||||
if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual))
|
if (!sk_POLICYQUALINFO_push(pol->qualifiers, qual))
|
||||||
goto merr;
|
goto merr;
|
||||||
qual->pqualid = OBJ_nid2obj(NID_id_qt_cps);
|
if(!(qual->pqualid = OBJ_nid2obj(NID_id_qt_cps))) {
|
||||||
qual->d.cpsuri = M_ASN1_IA5STRING_new();
|
X509V3err(X509V3_F_POLICY_SECTION, ERR_R_INTERNAL_ERROR);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
if(!(qual->d.cpsuri = M_ASN1_IA5STRING_new()))
|
||||||
|
goto merr;
|
||||||
if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
|
if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value,
|
||||||
strlen(cnf->value)))
|
strlen(cnf->value)))
|
||||||
goto merr;
|
goto merr;
|
||||||
@ -290,14 +294,18 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
|
|||||||
POLICYQUALINFO *qual;
|
POLICYQUALINFO *qual;
|
||||||
if (!(qual = POLICYQUALINFO_new()))
|
if (!(qual = POLICYQUALINFO_new()))
|
||||||
goto merr;
|
goto merr;
|
||||||
qual->pqualid = OBJ_nid2obj(NID_id_qt_unotice);
|
if(!(qual->pqualid = OBJ_nid2obj(NID_id_qt_unotice))) {
|
||||||
|
X509V3err(X509V3_F_NOTICE_SECTION, ERR_R_INTERNAL_ERROR);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
if (!(not = USERNOTICE_new()))
|
if (!(not = USERNOTICE_new()))
|
||||||
goto merr;
|
goto merr;
|
||||||
qual->d.usernotice = not;
|
qual->d.usernotice = not;
|
||||||
for (i = 0; i < sk_CONF_VALUE_num(unot); i++) {
|
for (i = 0; i < sk_CONF_VALUE_num(unot); i++) {
|
||||||
cnf = sk_CONF_VALUE_value(unot, i);
|
cnf = sk_CONF_VALUE_value(unot, i);
|
||||||
if (!strcmp(cnf->name, "explicitText")) {
|
if (!strcmp(cnf->name, "explicitText")) {
|
||||||
not->exptext = M_ASN1_VISIBLESTRING_new();
|
if(!(not->exptext = M_ASN1_VISIBLESTRING_new()))
|
||||||
|
goto merr;
|
||||||
if (!ASN1_STRING_set(not->exptext, cnf->value,
|
if (!ASN1_STRING_set(not->exptext, cnf->value,
|
||||||
strlen(cnf->value)))
|
strlen(cnf->value)))
|
||||||
goto merr;
|
goto merr;
|
||||||
|
Loading…
Reference in New Issue
Block a user