rt-tests: rt-utils: Fix potential 'debugfileprefix' overflow
PATCH 1/1 rt-tests: rt-utils: Fix potential 'debugfileprefix' overflow
fscanf on line 73 amounts to
fscanf(fp, "... %256s ...", debugfileprefix)
This can result in 256 characters excluding nul.
Add 1 to buffer size to accomodate a maximum write + a nul.
Signed-off-by Ian K. Coolidge <[email protected]>
--- src/lib/rt-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/lib/rt-utils.c +1 -1
@@ -32,7 +32,7 @@#define MAX_COMMAND_LINE 4096#define MAX_TS_SIZE 64 -static char debugfileprefix[MAX_PATH ]; +static char debugfileprefix[MAX_PATH +1 ];static char *fileprefix;static int trace_fd =-1 ;static int tracemark_fd =-1 ;
Signature · 1 line
2.37.0.rc0.161.g10f37bed90-goog