Validate the CLI player count before subtraction #15

Open
opened 2026-09-15 16:42:57 +00:00 by EIREXE · 0 comments
Owner

Severity: High

Args accepts --players 0 (src/args.rs:16-17), but default match setup evaluates args.players - 1 at src/match_loading.rs:188. Debug builds panic and release builds can wrap.

Fix: enforce the supported range in Clap and add parsing tests for zero, maximum, and excessive counts.

Severity: High Args accepts --players 0 (src/args.rs:16-17), but default match setup evaluates args.players - 1 at src/match_loading.rs:188. Debug builds panic and release builds can wrap. Fix: enforce the supported range in Clap and add parsing tests for zero, maximum, and excessive counts.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: EIREXE/shinespark#15