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

avoid potential null dereferences #140

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dornbirndevelops
Copy link

@dornbirndevelops dornbirndevelops commented Jan 3, 2025

with some warnings enabled, gcc 13 and above detect a potential null pointer dereference in the typed_value::notify member function.

@vprus
Copy link
Collaborator

vprus commented Jan 3, 2025

Thanks for the PR.

Can you tell why value might end up null? It seems like it's only possible due to user error and then it's better to crash than silently ignoring it?

@dornbirndevelops
Copy link
Author

Hi @vprus, thank you for the quick response.

I created a minimum reproducible example of my problem in compiler explorer using boost 1.86.0.
https://godbolt.org/z/efP1WxoKT

I tried to stick with the original example from the docs to minimize the chance of user error.
https://www.boost.org/doc/libs/1_86_0/doc/html/program_options/tutorial.html

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.

2 participants