From e6e225e081ca1b2584d8b8ba4b795771aa7f3741 Mon Sep 17 00:00:00 2001 From: LuisAntonRebollo Date: Sun, 11 May 2014 19:39:50 +0200 Subject: [PATCH] Fix for avoid a zero division on _StringTable::resize. --- Engine/source/core/stringTable.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Engine/source/core/stringTable.cpp b/Engine/source/core/stringTable.cpp index 3c2ff86f8..e94ca50e7 100644 --- a/Engine/source/core/stringTable.cpp +++ b/Engine/source/core/stringTable.cpp @@ -195,8 +195,11 @@ StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool cas } //-------------------------------------- -void _StringTable::resize(const U32 newSize) +void _StringTable::resize(const U32 _newSize) { + /// avoid a possible 0 division + const U32 newSize = _newSize ? _newSize : 1; + Node *head = NULL, *walk, *temp; U32 i; // reverse individual bucket lists