summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-04-20 16:25:21 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-04-21 10:37:13 +0200
commitd9a3c7b6f646fffb16f281c8776a3ab394c64ade (patch)
tree3b2ae97dffe9a4e7f1efd2270b1da887ca753c79
parent1f3f0b5fe56b6b59c531d81b4790c32fdb880410 (diff)
downloadgnutls-d9a3c7b6f646fffb16f281c8776a3ab394c64ade.tar.gz
ensure that the X.509 version number is one byte only
-rw-r--r--lib/x509/x509.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index eb59e1975b..db8b07df49 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -744,7 +744,7 @@ int gnutls_x509_crt_get_version(gnutls_x509_crt_t cert)
return _gnutls_asn2err(result);
}
- if (len == 0)
+ if (len != 1)
return gnutls_assert_val(GNUTLS_E_CERTIFICATE_ERROR);
return (int) version[0] + 1;