[test] Fix out of bound buffer read in switch_test

This commit is contained in:
Chris Rienzo 2020-03-18 15:26:04 +00:00 committed by Andrey Volk
parent b630dfa79e
commit bc9515468e
1 changed files with 1 additions and 1 deletions

View File

@ -863,7 +863,7 @@ cJSON *varname = NULL; \
int fd = open(file, O_RDONLY); \
fst_requires(fd >= 0); \
fstat(fd, &s); \
buf = malloc(s.st_size + 1); \
switch_zmalloc(buf, s.st_size + 1); \
fst_requires(buf); \
size = read(fd, buf, s.st_size); \
fst_requires(size == s.st_size); \