summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-12-05 10:37:25 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-12-05 10:52:25 +0100
commit37bad9875c8e44f63e7f0749353a90a9c84d167c (patch)
tree5fd074f1a09f9267825690a1a954dd8201aba6dc
parent355b24afb6cf6028120c60114e90e5daeaaacb4f (diff)
downloadgnutls-37bad9875c8e44f63e7f0749353a90a9c84d167c.tar.gz
_gnutls_x509_get_dn() always return a null terminated string
-rw-r--r--lib/x509/dn.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/x509/dn.c b/lib/x509/dn.c
index 19c5fcb44a..9dd31720e9 100644
--- a/lib/x509/dn.c
+++ b/lib/x509/dn.c
@@ -197,9 +197,13 @@ _gnutls_x509_get_dn(ASN1_TYPE asn1_struct,
}
while (1);
+ DATA_APPEND("\x00", 1);
result = _gnutls_buffer_to_datum(&out_str, dn);
if (result < 0)
gnutls_assert();
+ if (dn->size > 0) {
+ dn->size--;
+ }
goto cleanup1;