Skip to content

Commit

Permalink
Merge pull request #22315 from suzuki-shunsuke/fix/panic-traffic_mirr…
Browse files Browse the repository at this point in the history
…or_filter_rule

fix: change the type from array to slice to prevent a panic
  • Loading branch information
ewbankkit authored Dec 22, 2021
2 parents 0fd7bcd + dae3e0c commit 1044ca7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/22315.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_ec2_traffic_mirror_filter_rule: Prevent crash during resource read
```
2 changes: 1 addition & 1 deletion internal/service/ec2/traffic_mirror_filter_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func buildTrafficMirrorFilterRulePortRangeSchema(portRange *ec2.TrafficMirrorPor
return nil
}

var out [1]interface{}
out := make([]interface{}, 1)
elem := make(map[string]interface{})
elem["from_port"] = portRange.FromPort
elem["to_port"] = portRange.ToPort
Expand Down

0 comments on commit 1044ca7

Please sign in to comment.