mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Fix read past end of array
This commit is contained in:
parent
d4b4320f45
commit
a10e6e99d4
1 changed files with 7 additions and 4 deletions
|
|
@ -601,10 +601,13 @@ bool chompUTF8BOM( const char *inString, char **outStringPtr )
|
||||||
{
|
{
|
||||||
*outStringPtr = const_cast<char *>( inString );
|
*outStringPtr = const_cast<char *>( inString );
|
||||||
|
|
||||||
U8 bom[4];
|
bool valid = false;
|
||||||
dMemcpy( bom, inString, 4 );
|
if (inString[0] && inString[1] && inString[2])
|
||||||
|
{
|
||||||
bool valid = isValidUTF8BOM( bom );
|
U8 bom[4];
|
||||||
|
dMemcpy(bom, inString, 4);
|
||||||
|
valid = isValidUTF8BOM(bom);
|
||||||
|
}
|
||||||
|
|
||||||
// This is hackey, but I am not sure the best way to do it at the present.
|
// This is hackey, but I am not sure the best way to do it at the present.
|
||||||
// The only valid BOM is a UTF8 BOM, which is 3 bytes, even though we read
|
// The only valid BOM is a UTF8 BOM, which is 3 bytes, even though we read
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue