From f23dc088c1620f796f98c6cb1c850bba3730673f Mon Sep 17 00:00:00 2001 From: cenhuilin Date: Tue, 30 Sep 2025 16:51:58 +0800 Subject: [PATCH] options: check for NULL input string and fail --- ...check-for-NULL-input-string-and-fail.patch | 30 +++++++++++++++++++ fio.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0002-options-check-for-NULL-input-string-and-fail.patch diff --git a/0002-options-check-for-NULL-input-string-and-fail.patch b/0002-options-check-for-NULL-input-string-and-fail.patch new file mode 100644 index 0000000..ddc75bf --- /dev/null +++ b/0002-options-check-for-NULL-input-string-and-fail.patch @@ -0,0 +1,30 @@ +From 6a39dfaffdb8a6c2080eec0dc7fb1ee532d54025 Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Tue, 30 Sep 2025 16:19:17 +0800 +Subject: [PATCH] options: check for NULL input string and fail + +Waste of time busy work. + +Link: https://github.com/axboe/fio/issues/1982 +Signed-off-by: Jens Axboe +--- + options.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/options.c b/options.c +index cfece3f..941b788 100644 +--- a/options.c ++++ b/options.c +@@ -1616,6 +1616,9 @@ static int str_buffer_pattern_cb(void *data, const char *input) + struct thread_data *td = cb_data_to_td(data); + int ret; + ++ if (!input) ++ return 1; ++ + /* FIXME: for now buffer pattern does not support formats */ + ret = parse_and_fill_pattern_alloc(input, strlen(input), + &td->o.buffer_pattern, NULL, NULL, NULL); +-- +2.43.0 + diff --git a/fio.spec b/fio.spec index 5f1cc55..e5e5d9b 100644 --- a/fio.spec +++ b/fio.spec @@ -1,6 +1,6 @@ Name: fio Version: 3.40 -Release: 1 +Release: 2 Summary: Multithreaded IO generation tool License: GPL-2.0-only @@ -8,6 +8,7 @@ URL: http://git.kernel.dk/?p=fio.git;a=summary Source0: http://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2 Patch0001: 0001-Add-Zhaoxin-support-to-enable-tsc_reliable-and-arch_random-features.patch +Patch0002: 0002-options-check-for-NULL-input-string-and-fail.patch BuildRequires: gcc BuildRequires: libaio-devel @@ -76,6 +77,9 @@ make test %changelog +* Tue Sep 30 2025 cenhuilin - 3.40-2 +- options: check for NULL input string and fail + * Fri Aug 29 2025 wangkai <13474090681@163.com> - 3.40-1 - Update to 3.40 -- Gitee