diff options
Diffstat (limited to 'src/testcurl/https/tls_test_common.c')
-rw-r--r-- | src/testcurl/https/tls_test_common.c | 6 |
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 8679280f..b78ecbba 100644 --- a/src/testcurl/https/tls_test_common.c +++ b/src/testcurl/https/tls_test_common.c | |||
@@ -40,8 +40,8 @@ setup_ca_cert () | |||
40 | ca_cert_file_name, strerror (errno)); | 40 | ca_cert_file_name, strerror (errno)); |
41 | return NULL; | 41 | return NULL; |
42 | } | 42 | } |
43 | if (fwrite (ca_cert_pem, sizeof (char), strlen (ca_cert_pem), cert_fd) | 43 | if (fwrite (ca_cert_pem, sizeof (char), strlen (ca_cert_pem) + 1, cert_fd) |
44 | != strlen (ca_cert_pem)) | 44 | != strlen (ca_cert_pem) + 1) |
45 | { | 45 | { |
46 | fprintf (stderr, "Error: failed to write `%s. %s'\n", | 46 | fprintf (stderr, "Error: failed to write `%s. %s'\n", |
47 | ca_cert_file_name, strerror (errno)); | 47 | ca_cert_file_name, strerror (errno)); |
@@ -401,7 +401,7 @@ setup_session (gnutls_session_t * session, | |||
401 | return -1; | 401 | return -1; |
402 | } | 402 | } |
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); | 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 (cert->data == NULL) |
407 | { | 407 | { |