avoid potential null dereferences#140
avoid potential null dereferences#140dornbirndevelops wants to merge 1 commit intoboostorg:developfrom
Conversation
|
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? |
|
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. I tried to stick with the original example from the docs to minimize the chance of user error. |
|
Thanks for the reproducer, but I'm not entirely sure it's a valid problem. The only way notify would find null value there seems to be if a user either failed to call 'store'. But in that case, having 'notify' ignore empty values would just mask the problem, making it harder to debug? |
with some warnings enabled, gcc 13 and above detect a potential null pointer dereference in the
typed_value::notifymember function.