diff options
-rw-r--r-- | src/usr.bin/openssl/x509.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ | |||
1 | /* $OpenBSD: x509.c,v 1.7 2015/09/21 13:13:06 bcook Exp $ */ | 1 | /* $OpenBSD: x509.c,v 1.8 2015/09/21 13:32:55 bcook Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -721,6 +721,10 @@ bad: | |||
721 | 721 | ||
722 | z = i2d_X509(x, NULL); | 722 | z = i2d_X509(x, NULL); |
723 | m = malloc(z); | 723 | m = malloc(z); |
724 | if (m == NULL) { | ||
725 | BIO_printf(bio_err, "out of mem\n"); | ||
726 | goto end; | ||
727 | } | ||
724 | 728 | ||
725 | d = (unsigned char *) m; | 729 | d = (unsigned char *) m; |
726 | z = i2d_X509_NAME(X509_get_subject_name(x), &d); | 730 | z = i2d_X509_NAME(X509_get_subject_name(x), &d); |