Skip to content

getLeaderboard passes unvalidated limit to SQL #8

Description

@royalpinto007

Problem

getLeaderboard passes its argument straight into LIMIT ? with no clamp: LIMIT -1 in SQLite means unlimited (full table dump), NaN misbehaves.

Where

lib/db.ts (getLeaderboard(limit), no validation).

Acceptance

Add a failing test first calling getLeaderboard(-1) and getLeaderboard(NaN), expecting a bounded default page. Then fix.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions