Commit ebd5c6cd authored by Yulin Chen's avatar Yulin Chen

Add index-out-of-bounds check in trie.contains

parent 6a720386
......@@ -130,6 +130,9 @@ func (p *prefixTrie) contains(number rnet.NetworkNumber) (bool, error) {
if p.hasEntry() {
return true, nil
}
if p.targetBitPosition() < 0 {
return false, nil
}
bit, err := p.targetBitFromIP(number)
if err != nil {
return false, err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment