Skip to content

Commit

Permalink
Add index-out-of-bounds check in trie.contains
Browse files Browse the repository at this point in the history
  • Loading branch information
Yulin Chen committed Sep 25, 2017
1 parent 6a72038 commit ebd5c6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ebd5c6c

Please sign in to comment.