From 8cd2e8a8ed69b1bd5763b94d2864fc4854e7deb4 Mon Sep 17 00:00:00 2001 From: bcook <> Date: Mon, 21 Sep 2015 13:32:55 +0000 Subject: add a missing NULL check noted by Bill Parker (dogbert2) on github --- src/usr.bin/openssl/x509.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/usr.bin/openssl/x509.c b/src/usr.bin/openssl/x509.c index d0a6bcaa00..8699e9eef0 100644 --- a/src/usr.bin/openssl/x509.c +++ b/src/usr.bin/openssl/x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.c,v 1.7 2015/09/21 13:13:06 bcook Exp $ */ +/* $OpenBSD: x509.c,v 1.8 2015/09/21 13:32:55 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -721,6 +721,10 @@ bad: z = i2d_X509(x, NULL); m = malloc(z); + if (m == NULL) { + BIO_printf(bio_err, "out of mem\n"); + goto end; + } d = (unsigned char *) m; z = i2d_X509_NAME(X509_get_subject_name(x), &d); -- cgit v1.2.3-55-g6feb