mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 14:44:36 +00:00
Merge pull request #496 from JeffProgrammer/getWords_buffer_fix
Fix buffer overflow issue in StringUnit::getWords
This commit is contained in:
commit
802598766a
1 changed files with 3 additions and 3 deletions
|
|
@ -42,7 +42,7 @@ namespace StringUnit
|
|||
|
||||
buffer[0] = 0;
|
||||
|
||||
U32 sz;
|
||||
dsize_t sz;
|
||||
while(index--)
|
||||
{
|
||||
if(!*string)
|
||||
|
|
@ -71,7 +71,7 @@ namespace StringUnit
|
|||
if( startIndex > endIndex )
|
||||
return "";
|
||||
|
||||
S32 sz;
|
||||
dsize_t sz;
|
||||
S32 index = startIndex;
|
||||
while(index--)
|
||||
{
|
||||
|
|
@ -89,7 +89,7 @@ namespace StringUnit
|
|||
sz = dStrcspn(string, set);
|
||||
string += sz;
|
||||
|
||||
if( i < endIndex )
|
||||
if( i < endIndex && *string )
|
||||
string ++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue