From: Jens Axboe Date: Mon, 14 Apr 2014 16:13:46 +0000 (-0600) Subject: make_filename: another off-by-one buffer issue X-Git-Tag: fio-2.1.9~43 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=b400a20e5d688f3498b2e3e9ce5567d3496dd746;ds=sidebyside make_filename: another off-by-one buffer issue Signed-off-by: Jens Axboe --- diff --git a/init.c b/init.c index 75b997ef..21779c7b 100644 --- a/init.c +++ b/init.c @@ -942,7 +942,7 @@ static char *make_filename(char *buf, struct thread_options *o, { struct fpre_keyword *f; char copy[PATH_MAX]; - size_t dst_left = PATH_MAX; + size_t dst_left = PATH_MAX - 1; if (!o->filename_format || !strlen(o->filename_format)) { sprintf(buf, "%s.%d.%d", jobname, jobnum, filenum);