From 2a00e489122f6c4b525090dbdba2855a2ea2d519 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 20 Apr 2015 22:51:55 +0200 Subject: Upgraded to openssl 1.0.2a --- openssl/apps/dgst.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'openssl/apps/dgst.c') diff --git a/openssl/apps/dgst.c b/openssl/apps/dgst.c index adb7a060a..95e5fa3fc 100644 --- a/openssl/apps/dgst.c +++ b/openssl/apps/dgst.c @@ -293,6 +293,11 @@ int MAIN(int argc, char **argv) in = BIO_new(BIO_s_file()); bmd = BIO_new(BIO_f_md()); + if ((in == NULL) || (bmd == NULL)) { + ERR_print_errors(bio_err); + goto end; + } + if (debug) { BIO_set_callback(in, BIO_debug_callback); /* needed for windows 3.1 */ @@ -304,11 +309,6 @@ int MAIN(int argc, char **argv) goto end; } - if ((in == NULL) || (bmd == NULL)) { - ERR_print_errors(bio_err); - goto end; - } - if (out_bin == -1) { if (keyfile) out_bin = 1; @@ -460,6 +460,11 @@ int MAIN(int argc, char **argv) ERR_print_errors(bio_err); goto end; } + if (!sigbuf) { + BIO_printf(bio_err, "Out of memory\n"); + ERR_print_errors(bio_err); + goto end; + } siglen = BIO_read(sigbio, sigbuf, siglen); BIO_free(sigbio); if (siglen <= 0) { -- cgit v1.2.3