-
Notifications
You must be signed in to change notification settings - Fork 919
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
uthash: check findstr pointer validity in HASH_FIND_STR #258
Conversation
This to avoid the uthash_strlen to segfault with a null pointer
Hi @matteomartelli! I don't think this patch makes sense: As-is, it changes Each change has the same form: "If the 'string' to find is actually NULL, then pretend it was not found." My first thought was that you could achieve this by just overriding Still, I don't think it makes sense to slow down every user of
An alternative approach would be to use the "null object pattern":
So I'm inclined to close this. |
Hi @Quuxplusone , thanks for the quick reply. |
But that is just literally |
Sorry for the confusion, as you pointed out using |
Well, that probably depends on one's reading of the Standard. My impression is that in practice it's totally fine to write (Notice that But yeah, I'm unlikely to take any patches in this area. I think if the user wants to store string keys they should use |
I understand your point. Thanks for having addressed it. |
This to avoid the
uthash_strlen
to segfault with a null pointer