Commit 950d49d4 authored by Pavel Kopyl's avatar Pavel Kopyl Committed by Bernd Edlinger
Browse files

Add error handling in dsa_main and ASN1_i2d_bio.



CLA: trivial

Reviewed-by: default avatarKurt Roeckx <kurt@roeckx.be>
Reviewed-by: default avatarBernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/4600)

(cherry picked from commit a6f622bc)
parent 200de404
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -327,6 +327,9 @@ int MAIN(int argc, char **argv)
    } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
        EVP_PKEY *pk;
        pk = EVP_PKEY_new();
        if (pk == NULL)
           goto end;

        EVP_PKEY_set1_DSA(pk, dsa);
        if (outformat == FORMAT_PVK)
            i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
+3 −0
Original line number Diff line number Diff line
@@ -87,6 +87,9 @@ int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x)
    int i, j = 0, n, ret = 1;

    n = i2d(x, NULL);
    if (n <= 0)
        return 0;

    b = (char *)OPENSSL_malloc(n);
    if (b == NULL) {
        ASN1err(ASN1_F_ASN1_I2D_BIO, ERR_R_MALLOC_FAILURE);