summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos <nmav@crystal.(none)>2007-12-02 10:02:39 +0200
committerNikos <nmav@crystal.(none)>2007-12-02 10:02:39 +0200
commitdeaa3ac31c2e83c292562ab66c1817c7ebc27048 (patch)
tree567ead9549a54b6ed008a435301be5bf0efa226b
parentb3eaa51ad4c047ce075973d323fe629392a00435 (diff)
downloadgnutls-deaa3ac31c2e83c292562ab66c1817c7ebc27048.tar.gz
get_subject_alt_name() returns null terminated strings.
-rw-r--r--lib/x509/x509.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index a60e9099d5..7b78b3de0b 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -1026,16 +1026,18 @@ parse_general_name (ASN1_TYPE src, const char *src_name,
len = *name_size;
result = asn1_read_value (src, nptr, name, &len);
- *name_size = len;
+ *name_size = len + 1;
if (result == ASN1_MEM_ERROR)
return GNUTLS_E_SHORT_MEMORY_BUFFER;
-
+
if (result != ASN1_SUCCESS)
{
gnutls_assert ();
return _gnutls_asn2err (result);
}
+
+ name[len] = 0;
}
return type;
@@ -1142,6 +1144,7 @@ get_subject_alt_name (gnutls_x509_crt_t cert,
* with the required size. If the certificate does not have an
* Alternative name with the specified sequence number then
* %GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned.
+ *
**/
int
gnutls_x509_crt_get_subject_alt_name (gnutls_x509_crt_t cert,