summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpointel <rpointel@openbsd.org>2015-07-20 18:23:52 +0000
committerrpointel <rpointel@openbsd.org>2015-07-20 18:23:52 +0000
commit0a71567a6ebacc7dde0410ab2143f30a01bd88d4 (patch)
tree222c88890c1b07f78fb30a1146ac8fba16958829
parentAdd a quirk for Cirrus Logic PD6729, for earlier silicon versions of this (diff)
downloadwireguard-openbsd-0a71567a6ebacc7dde0410ab2143f30a01bd88d4.tar.xz
wireguard-openbsd-0a71567a6ebacc7dde0410ab2143f30a01bd88d4.zip
check the sigbuf value before using it.
ok miod@ (thanks).
-rw-r--r--usr.bin/openssl/dgst.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/openssl/dgst.c b/usr.bin/openssl/dgst.c
index 655b2083d05..c9ac057d01f 100644
--- a/usr.bin/openssl/dgst.c
+++ b/usr.bin/openssl/dgst.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dgst.c,v 1.2 2015/07/20 17:10:45 doug Exp $ */
+/* $OpenBSD: dgst.c,v 1.3 2015/07/20 18:23:52 rpointel Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -393,9 +393,14 @@ mac_end:
if (sigfile && sigkey) {
BIO *sigbio;
- sigbio = BIO_new_file(sigfile, "rb");
siglen = EVP_PKEY_size(sigkey);
sigbuf = malloc(siglen);
+ if (sigbuf == NULL) {
+ BIO_printf(bio_err, "out of memory\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ sigbio = BIO_new_file(sigfile, "rb");
if (!sigbio) {
BIO_printf(bio_err, "Error opening signature file %s\n",
sigfile);