summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhil Pennock <pdp@exim.org>2012-05-21 05:54:50 -0400
committerPhil Pennock <pdp@exim.org>2012-05-21 05:56:03 -0400
commit76d5098363019ec2c5a9b0f584c78a15a92e3bab (patch)
treeb85dc81893046369cdded221799688c633df6663 /src
parentf53d7cf7c6d5af5dd7c5c040e641b665e3d8f7e7 (diff)
avoid NUL in dh params file
gnutls_dh_params_export_pkcs3() returns 2 different sizes. NUL observed by Janne Snabb
Diffstat (limited to 'src')
-rw-r--r--src/src/tls-gnu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c
index 3ea02bd52..0ac72ad25 100644
--- a/src/src/tls-gnu.c
+++ b/src/src/tls-gnu.c
@@ -512,8 +512,9 @@ if (rc < 0)
m.data = malloc(m.size);
if (m.data == NULL)
return tls_error(US"memory allocation failed", strerror(errno), NULL);
+ /* this will return a size 1 less than the allocation size above */
rc = gnutls_dh_params_export_pkcs3(dh_server_params, GNUTLS_X509_FMT_PEM,
- m.data, &sz);
+ m.data, &m.size);
if (rc != GNUTLS_E_SUCCESS)
{
free(m.data);