-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Fix segmentation fault in "aws_api_gateway_base_path_mapping" resource #8466
Fix segmentation fault in "aws_api_gateway_base_path_mapping" resource #8466
Conversation
It is possible for the `mapping.BasePath`, `mapping.RestApiId`, and `mapping.Stage` to be nil when they have not been set for the mapping.[1] When this occurs a nil pointer is dereferenced and terraform segmentation faults. Here we remove the blind derefrences and trust in the behaviour of (*ResourceData).Set() to handle the nil pointer safely. [1] https://github.com/hashicorp/terraform/blob/master/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go#L4892-L4904
Hi @richardc Thanks so much for the PR here - you are indeed correct. We should pass the pointer into the Set func - that takes care of dereferencing it in the safe way :) Will merge this when green! Paul |
hashicorp#8466) It is possible for the `mapping.BasePath`, `mapping.RestApiId`, and `mapping.Stage` to be nil when they have not been set for the mapping.[1] When this occurs a nil pointer is dereferenced and terraform segmentation faults. Here we remove the blind derefrences and trust in the behaviour of (*ResourceData).Set() to handle the nil pointer safely. [1] https://github.com/hashicorp/terraform/blob/master/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go#L4892-L4904
@stack72 Hi, is this resolved? I still get this error with Terraform v0.7.5 :
I also noticed that the
|
@BerndWessels This change only targeted the segmentation fault that was possible with the code at the time. That you are managing to generate invalid configurations still would be a new issue, so it's probably better to continue this discussion in #8953 |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
It is possible for the
mapping.BasePath
,mapping.RestApiId
, andmapping.Stage
to be nil when they have not been set for themapping.[1] When this occurs a nil pointer is dereferenced and terraform
segmentation faults.
Here we remove the blind derefrences and trust in the behaviour of
(*ResourceData).Set() to handle the nil pointer safely.
[1] https://github.com/hashicorp/terraform/blob/master/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go#L4892-L4904