myxce/.wolf/bugs/bug-1710.md
Rongsong Shen 4c13412720
chore: sync harness batch and bug-1872/1874-1877 to Gitea (#298-#315)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 04:42:34 +00:00

1.7 KiB

id status status_updated status_note component severity timestamp last_seen occurrences files tags related fix_commits legacy gitea_issue gitea_synced_status gitea_synced_hash
bug-1710 fixed 2026-09-28 controller unknown 2026-08-26T09:32:18Z 2026-09-19T09:00:00Z 1
src/harness/test.c
controller
testsuite
xce_test
cmd_hello
silent-failure
cli-ux-audit
da1a663f
true 305 fixed 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).