Fix error in aiString documentation. MAXLEN includes the terminal NULL. This is unusual, but true.
Fix overflow vulnerability in SceneCombiner. Thanks to Krishty to point it out. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@683 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -62,6 +62,12 @@ inline void PrefixString(aiString& string,const char* prefix, unsigned int len)
|
||||
if (string.length >= 1 && string.data[0] == '$')
|
||||
return;
|
||||
|
||||
if (len+string.length>=MAXLEN-1) {
|
||||
DefaultLogger::get()->debug("Can't add an unique prefix because the string is too long");
|
||||
ai_assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add the prefix
|
||||
::memmove(string.data+len,string.data,string.length+1);
|
||||
::memcpy (string.data, prefix, len);
|
||||
|
||||
Reference in New Issue
Block a user