[test] Fix out of bound buffer read in switch_test
This commit is contained in:
parent
b630dfa79e
commit
bc9515468e
|
@ -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); \
|
||||
|
|
Loading…
Reference in New Issue