godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.45k stars 21.07k forks source link

Using `HashMap::get` with a null value crashes the engine when the key type is `const char *` #31463

Open Zylann opened 5 years ago

Zylann commented 5 years ago

Godot 3.2 master

It crashes because it then uses hash_djb2, which doesn't check for NULL. https://github.com/godotengine/godot/blob/ef37f00525643e391e19b79f84fc6fd15762b3be/core/hashfuncs.h#L50-L60

KoBeWi commented 4 years ago

The code seems unchanged in e40ba13, so likely still valid.