Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider: Prevent potential panics due to setting resource identifiers with raw string pointer dereferencing #16594

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Dec 4, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Reference: #12992

Release note for CHANGELOG:

NONE

These fixes were automatically applied by semgrep --autofix and are always safe since (helper/schema.ResourceData).SetId() only accepts a string type. Other types would generate a Go compilation error.

Output from acceptance testing (provided as a smoke test):

--- PASS: TestAccDataSourceAwsApiGatewayRestApi_basic (24.51s)

…s with raw string pointer dereferencing

Reference: #12992

These fixes were automatically applied by `semgrep --autofix` and are always safe since `(helper/schema.ResourceData).SetId()` only accepts a `string` type. Other types would generate a Go compilation error.

Output from acceptance testing (provided as a smoke test):

```
--- PASS: TestAccDataSourceAwsApiGatewayRestApi_basic (24.51s)
```
@bflad bflad requested a review from a team as a code owner December 4, 2020 16:35
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. service/acm Issues and PRs that pertain to the acm service. service/apigateway Issues and PRs that pertain to the apigateway service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/ec2 Issues and PRs that pertain to the ec2 service. service/efs Issues and PRs that pertain to the efs service. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. service/elasticache Issues and PRs that pertain to the elasticache service. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/elb Issues and PRs that pertain to the elb service. service/elbv2 Issues and PRs that pertain to the elbv2 service. service/iam Issues and PRs that pertain to the iam service. service/lambda Issues and PRs that pertain to the lambda service. service/rds Issues and PRs that pertain to the rds service. service/sfn Issues and PRs that pertain to the sfn service. service/ssm Issues and PRs that pertain to the ssm service. labels Dec 4, 2020
@anGie44 anGie44 self-requested a review December 9, 2020 20:32
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 💯 💯

@bflad bflad added this to the v3.21.0 milestone Dec 9, 2020
@bflad bflad merged commit 44884e5 into master Dec 9, 2020
@bflad bflad deleted the b-d-SetId-dereferencing branch December 9, 2020 20:42
@ghost
Copy link

ghost commented Dec 11, 2020

This has been released in version 3.21.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jan 9, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/acm Issues and PRs that pertain to the acm service. service/apigateway Issues and PRs that pertain to the apigateway service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/ec2 Issues and PRs that pertain to the ec2 service. service/efs Issues and PRs that pertain to the efs service. service/elasticache Issues and PRs that pertain to the elasticache service. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. service/elasticsearch Issues and PRs that pertain to the elasticsearch service. service/elb Issues and PRs that pertain to the elb service. service/elbv2 Issues and PRs that pertain to the elbv2 service. service/iam Issues and PRs that pertain to the iam service. service/lambda Issues and PRs that pertain to the lambda service. service/rds Issues and PRs that pertain to the rds service. service/sfn Issues and PRs that pertain to the sfn service. service/ssm Issues and PRs that pertain to the ssm service. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants