Merge pull request #313 from ajshort/patch-1

Fix overflow in STL header colour reading.
pull/321/head
Alexander Gessler 2014-07-12 16:47:57 +02:00
commit cd88ea745d
1 changed files with 2 additions and 2 deletions

View File

@ -348,8 +348,8 @@ bool STLImporter::LoadBinaryFile()
bool bIsMaterialise = false; bool bIsMaterialise = false;
// search for an occurence of "COLOR=" in the header // search for an occurence of "COLOR=" in the header
const char* sz2 = (const char*)mBuffer; const unsigned char* sz2 = (const unsigned char*)mBuffer;
const char* const szEnd = sz2+80; const unsigned char* const szEnd = sz2+80;
while (sz2 < szEnd) { while (sz2 < szEnd) {
if ('C' == *sz2++ && 'O' == *sz2++ && 'L' == *sz2++ && if ('C' == *sz2++ && 'O' == *sz2++ && 'L' == *sz2++ &&