forked from github/server
CID 22556: String not null terminated (STRING_NULL)
add missing null-termination
This commit is contained in:
parent
68f8f0830e
commit
7fa12ae3af
|
@ -76,7 +76,8 @@ int config_read(const char *filename, const char * relpath)
|
||||||
size_t sz = (size_t)size;
|
size_t sz = (size_t)size;
|
||||||
|
|
||||||
data = malloc(sz);
|
data = malloc(sz);
|
||||||
fread(data, 1, sz, F);
|
sz = fread(data, 1, sz, F);
|
||||||
|
data[sz] = 0;
|
||||||
fclose(F);
|
fclose(F);
|
||||||
result = config_parse(data);
|
result = config_parse(data);
|
||||||
free(data);
|
free(data);
|
||||||
|
|
Loading…
Reference in New Issue