From 82ccecc39e65abfcc8fa9ce4b235786a2129433a Mon Sep 17 00:00:00 2001 From: cenhuilin Date: Tue, 30 Sep 2025 17:07:28 +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 0004-options-check-for-NULL-input-string-and-fail.patch diff --git a/0004-options-check-for-NULL-input-string-and-fail.patch b/0004-options-check-for-NULL-input-string-and-fail.patch new file mode 100644 index 0000000..c00ea4e --- /dev/null +++ b/0004-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 17:02:55 +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 91049af..6913bf0 100644 +--- a/options.c ++++ b/options.c +@@ -1515,6 +1515,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 e431f2e..0fbfb29 100644 --- a/fio.spec +++ b/fio.spec @@ -1,6 +1,6 @@ Name: fio Version: 3.34 -Release: 5 +Release: 6 Summary: Multithreaded IO generation tool License: GPLv2 @@ -11,6 +11,7 @@ Source0: http://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2 Patch0001: 0001-fix-disk-stats-issue.patch Patch0002: 0002-engines-http-fix-memory-leak.patch Patch0003: 0003-Add-Zhaoxin-support-to-enable-tsc_reliable-and-arch_random-features.patch +Patch0004: 0004-options-check-for-NULL-input-string-and-fail.patch BuildRequires: gcc BuildRequires: libaio-devel @@ -84,6 +85,9 @@ make test %changelog +* Tue Sep 30 2025 cenhuilin - 3.34-6 +- options: check for NULL input string and fail + * Fri Aug 22 2025 cenhuilin - 3.34-5 - Add Zhaoxin support to enable tsc_reliable and arch_random features -- Gitee