Commit 4a98bb00 authored by Matt Caswell's avatar Matt Caswell
Browse files

Check the return value from ASN1_INTEGER_set



Found by Coverity

Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7169)

(cherry picked from commit 512d8117)
parent 6e873259
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -70,7 +70,8 @@ PKCS12 *PKCS12_init(int mode)
        PKCS12err(PKCS12_F_PKCS12_INIT, ERR_R_MALLOC_FAILURE);
        return NULL;
    }
    ASN1_INTEGER_set(pkcs12->version, 3);
    if (!ASN1_INTEGER_set(pkcs12->version, 3))
        goto err;
    pkcs12->authsafes->type = OBJ_nid2obj(mode);
    switch (mode) {
    case NID_pkcs7_data: