rust-fuzz / rust-fuzz/arbitrary

Enum discriminants should be taken from the end of the input string, like lengths

Open
#35 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

derive
Dominant language
Rust
Stars
880
Forks
93
PR merge metrics
No merged PRs in 30d

Description

The same rationale for why we take lengths from the end of the input byte string applies to discriminants: depending on the discriminant chosen, it changes which subsequent arbitrary calls are made and how many bytes are needed. It generally seems best to have "control flow"-y choices that affect shape be taken from the end of the input string and "filler" data taken from the start.

To do this we'll need to expose our internal int_in_range that takes from the end. Not sure what to call it, or how to explain why there are two variants in the documentation well...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the internal int_in_range entry point and the code that chooses enum discriminants, then compare their behavior with the linked FuzzedDataProvider rationale. Determine how to expose the end-consuming variant and document why both variants exist. Done means discriminants are selected from the end of the input while preserving the intended arbitrary-data behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.