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/aws: fix for https://github.com/aws/aws-sdk-go/issues/452 #4024

Merged
merged 1 commit into from
Nov 24, 2015

Conversation

rjeczalik
Copy link
Contributor

Fixes nil deref panic caused by aws/aws-sdk-go#452.

)

var defaultClient = ec2metadata.New(session.New(aws.NewConfig()))
Copy link

Choose a reason for hiding this comment

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

The additional aws.NewConfig() is not required when creating a new session. You could do just, ec2metadata.New(session.New()). The config parameter New takes is an optional variadic list of configs which will be merged on top of the session's copy of the default config sourced from the SDK's defaults package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

)

var defaultClient = ec2metadata.New(session.New())
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason for this to be defined here rather than as part of the allocation of ec2rolecreds.EC2RoleProvider on line 49?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. It was there to reuse single var.

@jen20
Copy link
Contributor

jen20 commented Nov 24, 2015

Hi @rjeczalik! Thanks for submitting this - I agree the change looks correct as per aws/aws-sdk-go#452. I've left a few comments in line on the diffs, could you let me you know what you think?

@rjeczalik
Copy link
Contributor Author

@jen20 Addressed, please take a look.

jen20 added a commit that referenced this pull request Nov 24, 2015
@jen20 jen20 merged commit 288e568 into hashicorp:master Nov 24, 2015
@jen20
Copy link
Contributor

jen20 commented Nov 24, 2015

Thanks @rjeczalik! I think this may address several crash reports, including #4036.

@ghost
Copy link

ghost commented Apr 29, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants