Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ref tools: hidden_ref accepts malformed numeric options

Closed Beginner friendly
#243 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
cli

Research direction

Start in tools/ref/hidden_ref.cpp at the numeric option parsing near line 130, where -c, -ngl and -t are read with atoi, and at line 150, where the context length is replaced by the prompt length. Replace each atoi call with a checked strtol conversion that rejects trailing characters, conversion errors and out-of-range values with a named message. Done when -c bad, -ngl bad and -t bad each exit with an error before inference runs.

Written by the indexing model from the issue text.

Description

review-bot

In hidden_ref.cpp, -c bad is parsed by atoi as zero and then replaced with the prompt length at line 150. Likewise, -ngl bad becomes zero GPU layers and -t bad selects the default thread count. With otherwise valid arguments, invalid input runs inference and writes a completed reference set. Parse the entire integer with strtol, reject conversion and range errors by name, and use the checked conversion for every numeric option.

Evidence (at the base of #242):

Filed by Shingler, the review bot, while reviewing #242; the defect is outside that pull request.

Dominant language
Rust
Stars
21
Forks
4
Avg merge
2h 32m
Merged PRs (30d)
530

Getting set up

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.

More from midagedev/bloomery

All issues in midagedev/bloomery

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.