forked from github/server
allocate space for null terminator
This commit is contained in:
parent
7fa12ae3af
commit
54304af182
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ int config_read(const char *filename, const char * relpath)
|
||||||
char *data;
|
char *data;
|
||||||
size_t sz = (size_t)size;
|
size_t sz = (size_t)size;
|
||||||
|
|
||||||
data = malloc(sz);
|
data = malloc(sz+1);
|
||||||
sz = fread(data, 1, sz, F);
|
sz = fread(data, 1, sz, F);
|
||||||
data[sz] = 0;
|
data[sz] = 0;
|
||||||
fclose(F);
|
fclose(F);
|
||||||
|
|
Loading…
Reference in a new issue