From e9fcefce9bb70f20c272a996443928c5f6ab8cd8 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Fri, 23 Oct 2015 19:46:02 +0000 Subject: Import OpenSSL 1.0.2d. --- crypto/x509/x509_set.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crypto/x509/x509_set.c') diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c index 4645777634b75..5b802bd6c7549 100644 --- a/crypto/x509/x509_set.c +++ b/crypto/x509/x509_set.c @@ -67,6 +67,11 @@ int X509_set_version(X509 *x, long version) { if (x == NULL) return (0); + if (version == 0) { + M_ASN1_INTEGER_free(x->cert_info->version); + x->cert_info->version = NULL; + return (1); + } if (x->cert_info->version == NULL) { if ((x->cert_info->version = M_ASN1_INTEGER_new()) == NULL) return (0); -- cgit v1.2.3