The following changes since commit 4a0c766c69ddfe5231d65f2676e97333ba89ab2b: Merge branch 'master' of https://github.com/michalbiesek/fio (2023-08-23 08:21:39 -0600) are available in the Git repository at: git://git.kernel.dk/fio.git master for you to fetch changes up to 904ee91c2831615a054a8dea9b164e96ae00abb3: Merge branch 'pcpp_parse_nr_fix' of https://github.com/PCPartPicker/fio (2023-09-02 07:35:49 -0600) ---------------------------------------------------------------- Jens Axboe (1): Merge branch 'pcpp_parse_nr_fix' of https://github.com/PCPartPicker/fio aggieNick02 (1): Add basic error checking to parsing nr from rw=randrw:<nr>, etc options.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) --- Diff of recent changes: diff --git a/options.c b/options.c index 48aa0d7b..65b2813c 100644 --- a/options.c +++ b/options.c @@ -596,9 +596,21 @@ static int str_rw_cb(void *data, const char *str) if (!nr) return 0; - if (td_random(td)) - o->ddir_seq_nr = atoi(nr); - else { + if (td_random(td)) { + long long val; + + if (str_to_decimal(nr, &val, 1, o, 0, 0)) { + log_err("fio: randrw postfix parsing failed\n"); + free(nr); + return 1; + } + if ((val <= 0) || (val > UINT_MAX)) { + log_err("fio: randrw postfix parsing out of range\n"); + free(nr); + return 1; + } + o->ddir_seq_nr = (unsigned int) val; + } else { long long val; if (str_to_decimal(nr, &val, 1, o, 0, 0)) {