Fix the following clang warnings by shrinking the scan size from 4096 to
4095 to allow room for the null terminating character.
cgexec.c:294:47: warning: 'sscanf' may overflow; destination buffer in
argument 4 has size 4096, but the corresponding specifier may require
size 4097 [-Wfortify-source]
294 | ret = sscanf(buffer, "%d::%4096s\n",
&idx, cgrp_name);
|
^
cgexec.c:296:63: warning: 'sscanf' may overflow; destination buffer in
argument 5 has size 4096, but the corresponding specifier may require
size 4097 [-Wfortify-source]
296 | ret = sscanf(buffer,
"%d:%[^:]:%4096s\n", &idx, ctrl_name, cgrp_name);
|
^
cgexec.c:423:40: warning: 'sscanf' may overflow; destination buffer in
argument 3 has size 4096, but the corresponding specifier may require
size 4097 [-Wfortify-source]
423 | ret = sscanf(buffer, "%*s %4096s\n", cgrp_path);
| ^
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>