Ensure that string always end up \0 terminated, too.
Signed-off-by: Jens Axboe <axboe@fb.com>
memset(&p, 0, sizeof(p));
- strcpy(p.ts.name, ts->name);
- strcpy(p.ts.verror, ts->verror);
- strcpy(p.ts.description, ts->description);
+ strncpy(p.ts.name, ts->name, FIO_JOBNAME_SIZE - 1);
+ strncpy(p.ts.verror, ts->verror, FIO_VERROR_SIZE - 1);
+ strncpy(p.ts.description, ts->description, FIO_JOBDESC_SIZE - 1);
p.ts.error = cpu_to_le32(ts->error);
p.ts.thread_number = cpu_to_le32(ts->thread_number);
};
enum {
- FIO_SERVER_VER = 32,
+ FIO_SERVER_VER = 33,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
/*
* These are per-group shared already
*/
- strncpy(ts->name, td->o.name, FIO_JOBNAME_SIZE);
+ strncpy(ts->name, td->o.name, FIO_JOBNAME_SIZE - 1);
if (td->o.description)
strncpy(ts->description, td->o.description,
- FIO_JOBNAME_SIZE);
+ FIO_JOBDESC_SIZE - 1);
else
- memset(ts->description, 0, FIO_JOBNAME_SIZE);
+ memset(ts->description, 0, FIO_JOBDESC_SIZE);
/*
* If multiple entries in this group, this is
#define MAX_PATTERN_SIZE 512
#define FIO_JOBNAME_SIZE 128
+#define FIO_JOBDESC_SIZE 256
#define FIO_VERROR_SIZE 128
struct thread_stat {
uint32_t thread_number;
uint32_t groupid;
uint32_t pid;
- char description[FIO_JOBNAME_SIZE];
+ char description[FIO_JOBDESC_SIZE];
uint32_t members;
uint32_t unified_rw_rep;