Fix infinite loop in decodeMap
This commit is contained in:
parent
1a9d040ea4
commit
21b17881bd
@ -199,6 +199,7 @@ func (d *decoder) decodeMap(name string, o *hcl.Object, result reflect.Value) er
|
||||
current := o
|
||||
for current != nil {
|
||||
if current.Value == nil {
|
||||
current = current.Next
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,17 @@ func TestDecode_interface(t *testing.T) {
|
||||
"foo": "bar",
|
||||
},
|
||||
},
|
||||
{
|
||||
"empty.hcl",
|
||||
false,
|
||||
map[string]interface{}{
|
||||
"resource": map[string]interface{}{
|
||||
"aws_instance": map[string]interface{}{
|
||||
"db": map[string]interface{}{},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
/*
|
||||
{
|
||||
"structure.hcl",
|
||||
|
1
test-fixtures/empty.hcl
Normal file
1
test-fixtures/empty.hcl
Normal file
@ -0,0 +1 @@
|
||||
resource "aws_instance" "db" {}
|
Loading…
Reference in New Issue
Block a user