Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@HWYkagiru
Copy link

This change adds a safety check at the start of ImHashStr to immediately return the seed if the input pointer data_p is nullptr. This prevents potential undefined behavior or crashes when hashing a null string.

@ocornut
Copy link
Owner

ocornut commented Dec 19, 2025

It would be invalid to call this function will a null pointer and should crash. I don’t agree with adding a null check there.

@ocornut
Copy link
Owner

ocornut commented Dec 19, 2025

It is expected that it would crash if you have it an invalid or null pointer.
The issue is that you are calling an undocumented internal function and passing it an invalid parameter.

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