mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- 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:
parent
bfb8886e93
commit
48229837ed
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue