From 7fa12ae3af8ced7e7e0271bed7d98351844fc585 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 30 Oct 2015 11:59:05 +0100 Subject: [PATCH] CID 22556: String not null terminated (STRING_NULL) add missing null-termination --- src/bind_config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bind_config.c b/src/bind_config.c index fd256a0cd..be3495dea 100644 --- a/src/bind_config.c +++ b/src/bind_config.c @@ -76,7 +76,8 @@ int config_read(const char *filename, const char * relpath) size_t sz = (size_t)size; data = malloc(sz); - fread(data, 1, sz, F); + sz = fread(data, 1, sz, F); + data[sz] = 0; fclose(F); result = config_parse(data); free(data);