Add bounds checks to the parsing utilities. (#5421)
* Add bounds checks to the parsing utilities. * Fix merge conflicts in ACLoader. * Fix loaders * Fix unittest of AC-Loader. * Remove dead code. * Md5Parser fixes * Fix md5-parsing * Fix Merge conflict * Fix merge conflicts. * Md5: Fix warning: missing return statement.
This commit is contained in:
@@ -159,7 +159,8 @@ void PLYImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
||||
mBuffer = (unsigned char *)&mBuffer2[0];
|
||||
|
||||
char *szMe = (char *)&this->mBuffer[0];
|
||||
SkipSpacesAndLineEnd(szMe, (const char **)&szMe);
|
||||
const char *end = &mBuffer2[0] + mBuffer2.size();
|
||||
SkipSpacesAndLineEnd(szMe, (const char **)&szMe, end);
|
||||
|
||||
// determine the format of the file data and construct the aiMesh
|
||||
PLY::DOM sPlyDom;
|
||||
@@ -167,7 +168,7 @@ void PLYImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy
|
||||
|
||||
if (TokenMatch(szMe, "format", 6)) {
|
||||
if (TokenMatch(szMe, "ascii", 5)) {
|
||||
SkipLine(szMe, (const char **)&szMe);
|
||||
SkipLine(szMe, (const char **)&szMe, end);
|
||||
if (!PLY::DOM::ParseInstance(streamedBuffer, &sPlyDom, this)) {
|
||||
if (mGeneratedMesh != nullptr) {
|
||||
delete (mGeneratedMesh);
|
||||
|
||||
Reference in New Issue
Block a user