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

Fix Nil pointer references for WebSystemdSocket #127

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

ethan-gallant
Copy link
Contributor

Noticed this when working with https://github.com/Lusitaniae/apache_exporter

If you don't provide a boolean value for WebSystemdSocket (default false) calling ListenAndServe causes the application to SigSegv. This checks if it is nil before evaluating the boolean value.

@ethan-gallant ethan-gallant changed the title Fix potential Nil pointer reference for WebSystemdSocket Fix potential Nil pointer references for WebSystemdSocket Feb 17, 2023
@ethan-gallant ethan-gallant changed the title Fix potential Nil pointer references for WebSystemdSocket Fix Nil pointer references for WebSystemdSocket Feb 17, 2023
Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Maybe a better check would be to make sure that there is at least one valid listener and error if there is none.

web/tls_config.go Outdated Show resolved Hide resolved
web/tls_config.go Outdated Show resolved Hide resolved
Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@SuperQ
Copy link
Member

SuperQ commented Mar 8, 2023

This needs a DCO sign-off. You can use git commit -s --amend to add it.

@ethan-gallant
Copy link
Contributor Author

@SuperQ should be good to go. Squashed commits and amended to have the signature

web/tls_config.go Outdated Show resolved Hide resolved
web/tls_config.go Outdated Show resolved Hide resolved
Signed-off-by: Ethan J. Gallant <ethan.gallant@acquia.com>

Co-authored-by: William Van Hevelingen <William.VanHevelingen@acquia.com>

Co-authored-by: Stephanie Palis <35511514+stephpalis@users.noreply.github.com>
change to var
@roidelapluie roidelapluie merged commit 54d6390 into prometheus:master Mar 9, 2023
@roidelapluie
Copy link
Member

Thanks!

SuperQ added a commit that referenced this pull request May 1, 2023
* [FEATURE] Client TLS: Add option to require a specific Subject Alternate Names #126
* [FEATURE] Add a POST form to the landing page #144
* [FEATURE] Add generic customization to landing page #146
* [ENHANCEMENT] Add a Content-Type header to the landing page #142
* [BUGFIX] Fix Nil pointer references for WebSystemdSocket #127

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ SuperQ mentioned this pull request May 1, 2023
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

Successfully merging this pull request may close these issues.

None yet

4 participants