summaryrefslogtreecommitdiff
path: root/drivers/builtin_openssl2/crypto/asn1/t_x509.c
diff options
context:
space:
mode:
authormrezai <mhd.rezai@gmail.com>2016-05-03 23:59:14 +0430
committermrezai <mhd.rezai@gmail.com>2016-05-03 23:59:14 +0430
commitab623c923d4e2c950342aec5da371cb92b1fbbc6 (patch)
tree14edc317fa408ca610bd85e6a82468dd347865db /drivers/builtin_openssl2/crypto/asn1/t_x509.c
parente0d27c55237d4f61910b1e72b744fc043e9b6bff (diff)
Update OpenSSL to 1.0.2h
Diffstat (limited to 'drivers/builtin_openssl2/crypto/asn1/t_x509.c')
-rw-r--r--drivers/builtin_openssl2/crypto/asn1/t_x509.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/builtin_openssl2/crypto/asn1/t_x509.c b/drivers/builtin_openssl2/crypto/asn1/t_x509.c
index 8aab55130c..8888396f84 100644
--- a/drivers/builtin_openssl2/crypto/asn1/t_x509.c
+++ b/drivers/builtin_openssl2/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;