From: Chris Rienzo Date: Wed, 18 Mar 2020 15:26:04 +0000 (+0000) Subject: [test] Fix out of bound buffer read in switch_test X-Git-Tag: v1.10.3^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc9515468e3f6bc60390707a494e5eff677b5447;p=thirdparty%2Ffreeswitch.git [test] Fix out of bound buffer read in switch_test --- diff --git a/src/include/test/switch_test.h b/src/include/test/switch_test.h index b320e3fdca..d343ead1b2 100644 --- a/src/include/test/switch_test.h +++ b/src/include/test/switch_test.h @@ -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); \