From 18953ca0b4742306b36c9abf243ef0599985b45e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulius=20Ratkevi=C4=8Dius?= Date: Sun, 19 May 2019 18:49:28 +0300 Subject: daemon: Added missing null terminator. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paulius Ratkevičius --- src/daemon/settings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/daemon/settings.c') 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"); -- cgit v1.2.3