From: yeeli <[email protected]>

This series fixes two small bugs found while reviewing ndctl v85.

Patch 1 adds the missing OPT_END() to key_options[].  Without it the
option parser walks past the end of the array and interprets the
adjacent sanitize_options[] array, so setup-passphrase lists and
accepts options that belong to sanitize-dimm.

Patch 2 makes util_bus_filter(), util_region_filter() and
util_dimm_filter() parse the current strtok_r() token instead of the
start of the duplicated identifier string.  Numeric lists such as
"0 1" therefore only matched their first entry.

Both issues were reproduced with the commands and harnesses described
in the individual patches.  The fixes were built and tested on an
x86 test system.

AI disclosure: the bug analysis, reproducers and initial fixes were
produced with the help of an AI coding assistant (DeepSeek V4.1
Flash, running in OpenCode).  The prompts asked for a review of
ndctl v85 for reproducible bugs, then for fixes to the option-table
termination and filter token parsing.  The assistant identified the
missing OPT_END(), wrote a harness for the filter bug, and proposed
both changes.  The submitter reviewed and verified the changes and
added the Signed-off-by tags; the assistant did not add them.

yeeli (2):
  ndctl/dimm: add missing OPT_END() to key_options
  ndctl/filter: parse the current token in util_*_filter

 ndctl/dimm.c   |  1 +
 ndctl/filter.c | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

-- 
2.34.1


Reply via email to