summaryrefslogtreecommitdiff
path: root/doc/examples/tlsauthentication.c
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/tlsauthentication.c')
-rw-r--r--doc/examples/tlsauthentication.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c
index 4d616b6f..f68a686f 100644
--- a/doc/examples/tlsauthentication.c
+++ b/doc/examples/tlsauthentication.c
@@ -98,12 +98,13 @@ load_file (const char *filename)
if (!fp)
return NULL;
- buffer = malloc (size);
+ buffer = malloc (size + 1);
if (!buffer)
{
fclose (fp);
return NULL;
}
+ buffer[size] = '\0';
if (size != fread (buffer, 1, size, fp))
{