Fix insufficient slice check (#2755)
This commit is contained in:
@@ -717,6 +717,19 @@ func TestTreeInvalidNodeType(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTreeInvalidParamsType(t *testing.T) {
|
||||
tree := &node{}
|
||||
tree.wildChild = true
|
||||
tree.children = append(tree.children, &node{})
|
||||
tree.children[0].nType = 2
|
||||
|
||||
// set invalid Params type
|
||||
params := make(Params, 0, 0)
|
||||
|
||||
// try to trigger slice bounds out of range with capacity 0
|
||||
tree.getValue("/test", ¶ms, false)
|
||||
}
|
||||
|
||||
func TestTreeWildcardConflictEx(t *testing.T) {
|
||||
conflicts := [...]struct {
|
||||
route string
|
||||
|
||||
Reference in New Issue
Block a user