- 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 committed by Rachael Alexanderson
parent bfb8886e93
commit 48229837ed

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;