aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-09 07:28:33 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-09 07:28:33 +0000
commit78e5722f4531168fc64acaa66ec8a0aecbc5b210 (patch)
tree9ee3dfca7fc2925be0e2a4d34c8598103b9dc077
parenta25dc0d379c0017e265729ab50e82715043ec0c4 (diff)
downloadlibmicrohttpd-78e5722f4531168fc64acaa66ec8a0aecbc5b210.tar.gz
libmicrohttpd-78e5722f4531168fc64acaa66ec8a0aecbc5b210.zip
-allow for 0-termination
-rw-r--r--src/testcurl/https/tls_test_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c
index b78ecbba..af4ae277 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -393,9 +393,9 @@ setup_session (gnutls_session_t * session,
393 const char *err_pos; 393 const char *err_pos;
394 394
395 gnutls_certificate_allocate_credentials (xcred); 395 gnutls_certificate_allocate_credentials (xcred);
396 key->size = strlen (srv_key_pem); 396 key->size = strlen (srv_key_pem) + 1;
397 key->data = malloc (key->size); 397 key->data = malloc (key->size);
398 if (key->data == NULL) 398 if (NULL == key->data)
399 { 399 {
400 gnutls_certificate_free_credentials (*xcred); 400 gnutls_certificate_free_credentials (*xcred);
401 return -1; 401 return -1;
@@ -403,7 +403,7 @@ setup_session (gnutls_session_t * session,
403 memcpy (key->data, srv_key_pem, key->size); 403 memcpy (key->data, srv_key_pem, key->size);
404 cert->size = strlen (srv_self_signed_cert_pem) + 1; 404 cert->size = strlen (srv_self_signed_cert_pem) + 1;
405 cert->data = malloc (cert->size); 405 cert->data = malloc (cert->size);
406 if (cert->data == NULL) 406 if (NULL == cert->data)
407 { 407 {
408 gnutls_certificate_free_credentials (*xcred); 408 gnutls_certificate_free_credentials (*xcred);
409 free (key->data); 409 free (key->data);