From dcae78a7a9c0fd83bb26f18e30a19551b132c62f Mon Sep 17 00:00:00 2001 From: k-stachowiak Date: Thu, 28 Jun 2018 16:32:54 +0200 Subject: [PATCH] Make a buffer limit more specific --- library/x509_crt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/x509_crt.c b/library/x509_crt.c index ca8b4649e..493d6334f 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -574,7 +574,8 @@ static int x509_get_crt_ext( unsigned char **p, end_ext_data = *p + len; /* Get extension ID */ - if( ( ret = mbedtls_asn1_get_tag( p, end, &extn_oid.len, MBEDTLS_ASN1_OID ) ) != 0 ) + if( ( ret = mbedtls_asn1_get_tag( p, end_ext_data, &extn_oid.len, + MBEDTLS_ASN1_OID ) ) != 0 ) return( MBEDTLS_ERR_X509_INVALID_EXTENSIONS + ret ); extn_oid.tag = MBEDTLS_ASN1_OID;