summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/t_x509.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2016-05-03 18:00:27 +0000
committerjkim <jkim@FreeBSD.org>2016-05-03 18:00:27 +0000
commitacb827e3083196de4c00b67ac9ae3bf860ffd4a9 (patch)
tree2dd85c58056a364765d9ae59d6a1774d41f88523 /crypto/asn1/t_x509.c
parent72d32bf80dfdcfe0e69da200b66f195e919653f7 (diff)
downloadFreeBSD-src-acb827e3083196de4c00b67ac9ae3bf860ffd4a9.zip
FreeBSD-src-acb827e3083196de4c00b67ac9ae3bf860ffd4a9.tar.gz
Import OpenSSL 1.0.2h.
Diffstat (limited to 'crypto/asn1/t_x509.c')
-rw-r--r--crypto/asn1/t_x509.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c
index 8aab551..8888396 100644
--- a/crypto/asn1/t_x509.c
+++ b/crypto/asn1/t_x509.c
@@ -140,7 +140,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
goto err;
bs = X509_get_serialNumber(x);
- if (bs->length <= (int)sizeof(long)) {
+ if (bs->length < (int)sizeof(long)
+ || (bs->length == sizeof(long) && (bs->data[0] & 0x80) == 0)) {
l = ASN1_INTEGER_get(bs);
if (bs->type == V_ASN1_NEG_INTEGER) {
l = -l;
OpenPOWER on IntegriCloud