summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/x_x509.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/asn1/x_x509.c')
-rw-r--r--crypto/asn1/x_x509.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/asn1/x_x509.c b/crypto/asn1/x_x509.c
index 63c15e8830..e2cac83694 100644
--- a/crypto/asn1/x_x509.c
+++ b/crypto/asn1/x_x509.c
@@ -186,9 +186,7 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
return NULL;
/* update length */
length -= q - *pp;
- if (!length)
- return ret;
- if (!d2i_X509_CERT_AUX(&ret->aux, &q, length))
+ if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length))
goto err;
*pp = q;
return ret;