diff options
| author | miod <> | 2014-07-13 11:15:54 +0000 |
|---|---|---|
| committer | miod <> | 2014-07-13 11:15:54 +0000 |
| commit | 51eac40810fca13318e009e19dc3c1049fda6783 (patch) | |
| tree | 2fc3d9289a534a38e9e28ee479ffcdce89e5a8d2 /src/lib/libc | |
| parent | bb6ecc6d127525e219bd52f088338bd8de903206 (diff) | |
| download | openbsd-51eac40810fca13318e009e19dc3c1049fda6783.tar.gz openbsd-51eac40810fca13318e009e19dc3c1049fda6783.tar.bz2 openbsd-51eac40810fca13318e009e19dc3c1049fda6783.zip | |
Check X509_NAME_oneline() return value when it will have to allocate memory.
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_cmp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_cmp.c b/src/lib/libcrypto/x509/x509_cmp.c index b63faaad2c..e783683f3a 100644 --- a/src/lib/libcrypto/x509/x509_cmp.c +++ b/src/lib/libcrypto/x509/x509_cmp.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_cmp.c,v 1.23 2014/07/12 16:03:37 miod Exp $ */ | 1 | /* $OpenBSD: x509_cmp.c,v 1.24 2014/07/13 11:15:54 miod 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 | * |
| @@ -93,6 +93,8 @@ X509_issuer_and_serial_hash(X509 *a) | |||
| 93 | 93 | ||
| 94 | EVP_MD_CTX_init(&ctx); | 94 | EVP_MD_CTX_init(&ctx); |
| 95 | f = X509_NAME_oneline(a->cert_info->issuer, NULL, 0); | 95 | f = X509_NAME_oneline(a->cert_info->issuer, NULL, 0); |
| 96 | if (f == NULL) | ||
| 97 | goto err; | ||
| 96 | if (!EVP_DigestInit_ex(&ctx, EVP_md5(), NULL)) | 98 | if (!EVP_DigestInit_ex(&ctx, EVP_md5(), NULL)) |
| 97 | goto err; | 99 | goto err; |
| 98 | if (!EVP_DigestUpdate(&ctx, (unsigned char *)f, strlen(f))) | 100 | if (!EVP_DigestUpdate(&ctx, (unsigned char *)f, strlen(f))) |
