ref tools: hidden_ref accepts malformed numeric options
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
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
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from midagedev/bloomery
-
review-bot
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
review-bot
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
model
Difficulty 5/5 Over a week Newbie friendliness 25/100
midagedev/bloomery#698 · 3 comments ·
Maintainers usually reply within 1 day
-
model
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
model
Difficulty 5/5 Over a week Newbie friendliness 25/100
midagedev/bloomery#632 · 9 comments ·
Maintainers usually reply within 1 day
All issues in midagedev/bloomery
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 67/100
rust-bitcoin/rust-bitcoin#7089 · 1 comment · 1 reaction ·
Maintainers usually reply within 2 days
-
area/tools bug session-analysis
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[Bug]: Python OpenTelemetrySectionConfig has no file_sinksMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NVIDIA/NeMo-Relay#1514 ·
Maintainers usually reply within 1 day
-
prompting proposal tool triaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
can1357/oh-my-pi#17041 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
nix-community/fenix#262 ·