rt-migrate-test: increase the buf size to 2048 when parse cpuinfo
PATCH 1/1 rt-migrate-test: increase the buf size to 2048 when parse cpuinfo
When parse /proc/cpuinfo, the size of "flags" may exceed 1024, this will cause "realloc(): invalid next size" error, increase the buf size to 2048 to fix this case.
Signed-off-by Liwei Song <[email protected]>
--- src/rt-migrate-test/rt-migrate-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/rt-migrate-test/rt-migrate-test.c +2 -2
@@ -497,14 +497,14 @@ static void stop_log(int sig)static int count_cpus (void ) {FILE *fp; -char buf[1024 ]; +char buf[2048 ];int cpus =0 ;char *pbuf;size_t *pn;size_t n;int r; - n =1024 ; + n =2048 ; pn = &n; pbuf = buf;
Signature · 1 line
2.17.1
Quoted 32 lines · Liwei Song
When parse
/proc/cpuinfo, the size of "flags" may exceed 1024, this will cause "realloc(): invalid next size" error, increase the buf size to 2048 to fix this case.Signed-off-by Liwei Song <[email protected]>--- src/rt-migrate-test/rt-migrate-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)src/rt-migrate-test/rt-migrate-test.c +2
-2@@ -497,14 +497,14 @@ static void stop_log(int sig)static int count_cpus (void ) {FILE *fp; -char buf[1024 ]; +char buf[2048 ];int cpus =0 ;char *pbuf;size_t *pn;size_t n;int r; - n =1024 ; + n =2048 ; pn = &n; pbuf = buf;Signature · 1 line
2.17.1
Signed-off-by John Kacur <[email protected]>