diff options
| author | tb <> | 2021-08-24 15:23:03 +0000 |
|---|---|---|
| committer | tb <> | 2021-08-24 15:23:03 +0000 |
| commit | 52abe2974a6ccf1fbf26a380d1f675aacc9aae28 (patch) | |
| tree | c39cdb8b332be4446a8637c55f18a2a1f4c7ec18 /src/lib/libcrypto/x509/x509_pci.c | |
| parent | 3b5f7f2deeb8133ab932229a210a97daf715b5f1 (diff) | |
| download | openbsd-52abe2974a6ccf1fbf26a380d1f675aacc9aae28.tar.gz openbsd-52abe2974a6ccf1fbf26a380d1f675aacc9aae28.tar.bz2 openbsd-52abe2974a6ccf1fbf26a380d1f675aacc9aae28.zip | |
Fix various read buffer overflow when printing ASN.1 strings (which are
not necessarily NUL terminated). Same as schwarze's fix in t_x509a.c r1.9.
From David Benjamin and Matt Caswell (part of the fixes in OpenSSL 1.1.1l)
ok inoguchi
Diffstat (limited to 'src/lib/libcrypto/x509/x509_pci.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_pci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_pci.c b/src/lib/libcrypto/x509/x509_pci.c index 8997f0cec8..b1d31dfb44 100644 --- a/src/lib/libcrypto/x509/x509_pci.c +++ b/src/lib/libcrypto/x509/x509_pci.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_pci.c,v 1.1 2020/06/04 15:19:31 jsing Exp $ */ | 1 | /* $OpenBSD: x509_pci.c,v 1.2 2021/08/24 15:23:03 tb Exp $ */ |
| 2 | /* Contributed to the OpenSSL Project 2004 | 2 | /* Contributed to the OpenSSL Project 2004 |
| 3 | * by Richard Levitte (richard@levitte.org) | 3 | * by Richard Levitte (richard@levitte.org) |
| 4 | */ | 4 | */ |
| @@ -77,7 +77,8 @@ i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *pci, BIO *out, | |||
| 77 | i2a_ASN1_OBJECT(out, pci->proxyPolicy->policyLanguage); | 77 | i2a_ASN1_OBJECT(out, pci->proxyPolicy->policyLanguage); |
| 78 | BIO_puts(out, "\n"); | 78 | BIO_puts(out, "\n"); |
| 79 | if (pci->proxyPolicy->policy && pci->proxyPolicy->policy->data) | 79 | if (pci->proxyPolicy->policy && pci->proxyPolicy->policy->data) |
| 80 | BIO_printf(out, "%*sPolicy Text: %s\n", indent, "", | 80 | BIO_printf(out, "%*sPolicy Text: %.*s\n", indent, "", |
| 81 | pci->proxyPolicy->policy->length, | ||
| 81 | pci->proxyPolicy->policy->data); | 82 | pci->proxyPolicy->policy->data); |
| 82 | return 1; | 83 | return 1; |
| 83 | } | 84 | } |
