44 lines
1.7 KiB
Markdown
44 lines
1.7 KiB
Markdown
---
|
|
id: "bug-1710"
|
|
status: "fixed"
|
|
status_updated: "2026-09-28"
|
|
status_note: ""
|
|
component: "controller"
|
|
severity: "unknown"
|
|
timestamp: "2026-08-26T09:32:18Z"
|
|
last_seen: "2026-09-19T09:00:00Z"
|
|
occurrences: 1
|
|
files: ["src/harness/test.c"]
|
|
tags: ["controller", "testsuite", "xce_test", "cmd_hello", "silent-failure", "cli-ux-audit"]
|
|
related: []
|
|
fix_commits: ["da1a663f"]
|
|
legacy: true
|
|
gitea_issue: 305
|
|
gitea_synced_status: "fixed"
|
|
gitea_synced_hash: "3805fa3a8bb8"
|
|
---
|
|
|
|
# bug-1710: cmd_hello with -c 0, a negative count, or a non-numeric value (all yield count<=0 from unchecked…
|
|
|
|
## Description
|
|
cmd_hello with -c 0, a negative count, or a non-numeric value (all yield count<=0 from unchecked atoi()) sends zero hellos (the while(count>0) loop body never runs) but still returns the still-zero-initialized rc, reporting success even though nothing was sent.
|
|
|
|
## Environment
|
|
_Not recorded (migrated from buglog.json)._
|
|
|
|
## Reproduction
|
|
_Not recorded (migrated from buglog.json)._
|
|
|
|
## Root cause
|
|
No validation that count is >=1 before entering the loop; the initial success value is never overwritten when the loop body never executes.
|
|
|
|
## Fix
|
|
hello's -c is parsed with cmdutil_parse_long() and must be >= 1; 0, negative or non-numeric is a usage error.
|
|
|
|
## Verification
|
|
- Test: test_hello_nonpositive_count_rejected in src/harness/testsuite/test_test_cli.c: RED before the fix (exit 0, nothing sent), GREEN after
|
|
- Suites: harness 6/6 (asan): harness_unit_test 141/0, cmdutil 14/0, resval_typeresolve 7/0, joblist_display 22/0, join_worker_args 7/0, listrow_json 12/0
|
|
- Live: n/a; xce_test is a client tool and every case above runs without a controller
|
|
|
|
## References
|
|
_Not recorded (migrated from buglog.json)._
|