summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/daemon/settings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/daemon/settings.c b/src/daemon/settings.c
index 822397d..5809139 100644
--- a/src/daemon/settings.c
+++ b/src/daemon/settings.c
@@ -130,8 +130,8 @@ static int setting_readconf(const char * const path)
}
fstat(fd, &filestat);
- buf = malloc(filestat.st_size);
-
+ buf = malloc(filestat.st_size+1);
+ buf[filestat.st_size] = 0;
if (read(fd, buf, filestat.st_size) != filestat.st_size) {
if (USURP_VERBOSITY >= 2) {
perror("partial read of configuration file detected");