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

Possible bug in getTLSCertificate where err might not be returned #174

Open
yangmarcyang opened this issue Nov 23, 2021 · 3 comments
Open

Comments

@yangmarcyang
Copy link
Contributor

yangmarcyang commented Nov 23, 2021

In v2/spiffetls/tlsconfig/config.go getTLSCertificate function, the return nil, err is put inside the if trace.GotCertificate != nil block. So, it sounds like a bug when trace.GotCertificate is not configured, where the error would not be returned and the following code would cause panic when dereferencing svid s.

Code pointer: link

If it is a real bug, the fix would look very simple: just move the return statement outside below the if block.

@azdagron
Copy link
Member

That is a bug!

@azdagron
Copy link
Member

azdagron commented Nov 23, 2021

Your suggested fix is spot on.

@yangmarcyang
Copy link
Contributor Author

Your suggested fix is spot on.

Thanks for the confirmation. I will create a PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants