CHERIoT-Platform / CHERIoT-Platform/network-stack
SmallTable can store the same rule more than once
- Dominant language
- C++
- Stars
- 9
- Forks
- 14
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 1
Description
1. Problem
The comment says that an item must not be added twice:
```cpp
/**
* Inserts a new element into the table. Does nothing if the element is
* already present.
*/
```
However, the check is commented out:
```cpp
// if (contains(element))
{
// return;
}
```
[`[SmallTable::insert()](https://github.com/CHERIoT-Platform/network-stack/blob/58425e6a1c65c4357b037aa817ba492e7a8fa70b/lib/firewall/firewall.cc#L238-L257)`](https://github.com/CHERIoT-Platform/network-stack/blob/58425e6a1c65c4357b037aa817ba492e7a8fa70b/lib/firewall/firewall.cc#L238-L257)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in lib/firewall/firewall.cc at SmallTable::insert(), especially the commented contains(element) check around lines 238–257. Confirm how insertion currently handles an existing element, then verify that inserting the same rule more than once leaves only one copy in the table.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100