CID 22556: String not null terminated (STRING_NULL)

add missing null-termination
This commit is contained in:
Enno Rehling 2015-10-30 11:59:05 +01:00
parent 68f8f0830e
commit 7fa12ae3af
1 changed files with 2 additions and 1 deletions

View File

@ -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);