Skip to content

check_valid() accepts empty candidate lists and max_choices = 0 #35

Closed

Description

@HellFelix

check_valid() does not guard against an empty candidates list or max_choices = 0. Both cases pass validation and produce a vote round where no meaningful vote can be cast, with no error surfaced to anyone.

File: rustsystem-server/src/proof/ballot.rs:77-88

Fix: Add self.candidates.is_empty() and self.max_choices == 0 guards.

Activity

  1. added
    bugSomething isn't working
    LowLow priority
    on Mar 4, 2026
  2. added this to the v2.1 milestone on Mar 4, 2026
  3. HellFelix commented on Apr 14, 2026

    @HellFelix
    CollaboratorAuthor

    There is an equivalent guard on the frontend that enforces these same checks, but these are more meant as a convenience/UX nicety than a guard.

  4. HellFelix commented on Apr 14, 2026

    @HellFelix
    CollaboratorAuthor

    Fixed with 8e33e66. Merged to stage with #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    LowLow prioritybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions