diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-04-18 23:34:57 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2014-04-18 23:36:08 +0200 |
commit | db327838d7861ac485caf8b71f6f591e9cbbc184 (patch) | |
tree | 72eaf0bedde973dd166472d004e6ae48ba537dbb /lib | |
parent | fa8f6f63da598c16a144f9aceee6d904e3207f3a (diff) | |
download | gnutls-db327838d7861ac485caf8b71f6f591e9cbbc184.tar.gz |
always initialize size values
Diffstat (limited to 'lib')
-rw-r--r-- | lib/x509/x509_ext.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c index 3ae37889a3..d81e04a0a4 100644 --- a/lib/x509/x509_ext.c +++ b/lib/x509/x509_ext.c @@ -246,6 +246,7 @@ int gnutls_x509_ext_import_subject_alt_names(const gnutls_datum_t * ext, i = 0; do { san.data = NULL; + san.size = 0; othername_oid.data = NULL; ret = _gnutls_parse_general_name2(c2, "", i, &san, &type, 0); @@ -259,6 +260,10 @@ int gnutls_x509_ext_import_subject_alt_names(const gnutls_datum_t * ext, NULL, 1); if (ret < 0) break; + + } else if (san.size == 0 || san.data == NULL) { + ret = gnutls_assert_val(GNUTLS_E_X509_UNKNOWN_SAN); + break; } ret = subject_alt_names_set(&sans->names, &sans->size, @@ -880,6 +885,7 @@ int gnutls_x509_ext_import_authority_key_id(const gnutls_datum_t * ext, i = 0; do { san.data = NULL; + san.size = 0; othername_oid.data = NULL; ret = _gnutls_parse_general_name2(c2, "authorityCertIssuer", i, @@ -2302,6 +2308,7 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext, i = 0; do { san.data = NULL; + san.size = 0; snprintf(name, sizeof(name), "?%u.reasons", (unsigned)i + 1); @@ -2953,6 +2960,7 @@ int gnutls_x509_ext_import_key_purposes(const gnutls_datum_t * ext, p->oid[i].size = oid.size; oid.data = NULL; + oid.size = 0; p->size++; } |