Merge pull request #629 from turol/afl-fixes

Avoid reading past EOF when encountering a malformed STL file
pull/633/head
Kim Kulling 2015-08-10 16:53:58 +02:00
commit 4cc67a3ccc
1 changed files with 1 additions and 1 deletions

View File

@ -279,7 +279,7 @@ void STLImporter::LoadASCIIFile()
break; break;
} }
// facet normal -0.13 -0.13 -0.98 // facet normal -0.13 -0.13 -0.98
if (!strncmp(sz,"facet",5) && IsSpaceOrNewLine(*(sz+5))) { if (!strncmp(sz,"facet",5) && IsSpaceOrNewLine(*(sz+5)) && *(sz + 5) != '\0') {
if (3 != curVertex) { if (3 != curVertex) {
DefaultLogger::get()->warn("STL: A new facet begins but the old is not yet complete"); DefaultLogger::get()->warn("STL: A new facet begins but the old is not yet complete");