mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
-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()
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user