Game Development Community

Possible crash in NetStringTable

by Thomas Huehn · in Torque Game Engine · 11/06/2008 (3:25 am) · 2 replies

You can try out the crash on TGE/TGEA and TGB with: gettaggedString(24323412);

The problem is, that getTaggedString "calls const char *NetStringTable::lookupString(U32 id)" where the id is not validated. If id is higher than the objects size the engine crash. This can also happen in other related NetStringTable functions.

Solution:

if (id >= size) return NULL;
or on other functions:
if (id >= size) return;

#1
11/06/2008 (6:30 am)
Just curious - Did you really have 24 million tagged strings, or was this the result of an error?
#2
11/06/2008 (6:46 am)
No it was just an example number. It also works with gettaggedString(16) if size is 16.