diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-02-29 12:27:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-02-29 12:27:57 +0000 |
commit | d3b17d3b19ad509e6e355677cc7fea73eb15c1b9 (patch) | |
tree | 855964315d66536482caa23d3d2fbc6d90f6357b | |
parent | 601164fa3539f34369374788ad626b1c14e486be (diff) | |
download | libmicrohttpd-d3b17d3b19ad509e6e355677cc7fea73eb15c1b9.tar.gz libmicrohttpd-d3b17d3b19ad509e6e355677cc7fea73eb15c1b9.zip |
-Fabian Mewes:
Fix the out-of-bound read of the NUL byte using strlen() in
microhttpd/daemon.c:MHD_init_daemon_certificate()
Fix the out-of-bound read of the NUL byte using strlen() in
microhttpd/daemon.c:MHD_init_daemon_certificate()
-rw-r--r-- | doc/examples/tlsauthentication.c | 3 |
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) | |||
98 | if (!fp) | 98 | if (!fp) |
99 | return NULL; | 99 | return NULL; |
100 | 100 | ||
101 | buffer = malloc (size); | 101 | buffer = malloc (size + 1); |
102 | if (!buffer) | 102 | if (!buffer) |
103 | { | 103 | { |
104 | fclose (fp); | 104 | fclose (fp); |
105 | return NULL; | 105 | return NULL; |
106 | } | 106 | } |
107 | buffer[size] = '\0'; | ||
107 | 108 | ||
108 | if (size != fread (buffer, 1, size, fp)) | 109 | if (size != fread (buffer, 1, size, fp)) |
109 | { | 110 | { |