- fixed: ACSStringPool::AddString did not check for NULL pointers as input. Let's just map them to the empty string, that's a lot better than crashing.

This commit is contained in:
Christoph Oelckers 2016-11-01 13:36:33 +01:00
parent 4cf0d76e8c
commit 3f57269a8b

View file

@ -375,6 +375,7 @@ void ACSStringPool::Clear()
int ACSStringPool::AddString(const char *str) int ACSStringPool::AddString(const char *str)
{ {
if (str == nullptr) str = "";
size_t len = strlen(str); size_t len = strlen(str);
unsigned int h = SuperFastHash(str, len); unsigned int h = SuperFastHash(str, len);
unsigned int bucketnum = h % NUM_BUCKETS; unsigned int bucketnum = h % NUM_BUCKETS;