diff options
| author | bcook <> | 2015-09-21 13:32:55 +0000 |
|---|---|---|
| committer | bcook <> | 2015-09-21 13:32:55 +0000 |
| commit | b15d8c593eec3a6437fc962608396fa0c9fe134b (patch) | |
| tree | adb59c5ad8cd4b7adff540f7b112f47adf107c66 | |
| parent | 70824484902839a90093eae619ab18728e76d3d0 (diff) | |
| download | openbsd-b15d8c593eec3a6437fc962608396fa0c9fe134b.tar.gz openbsd-b15d8c593eec3a6437fc962608396fa0c9fe134b.tar.bz2 openbsd-b15d8c593eec3a6437fc962608396fa0c9fe134b.zip | |
add a missing NULL check
noted by Bill Parker (dogbert2) on github
Diffstat (limited to '')
| -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); |
