hyperium / hyperium/http

HeaderMap::try_with_capacity can panic when capacity is large

Open
#709 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.4k
Forks
378
Avg merge
1d 21h
Merged PRs (30d)
5

Description

In PR #617, try_methods are provided to prevent the panic
In PR #628, capacity overflow is resolve but introduce panic

Just like implementation in hashbrown, maybe to_raw_capacity can return Option<usize> too.

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 with HeaderMap::try_with_capacity and trace its capacity handling through to_raw_capacity. Compare the referenced hashbrown implementation and the changes from PRs #617 and #628; done means a large capacity no longer causes a panic while the try method reports failure appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.