From e5ddb98dde79530d3bacd83c806d36924d2accf8 Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Tue, 11 Aug 2015 15:53:16 +0300 Subject: [PATCH] STL: Fix another read past EOF --- code/STLLoader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index 1bf47dcf2..fc6ca0661 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -304,6 +304,9 @@ void STLImporter::LoadASCIIFile() } else { + if (sz[6] == '\0') { + throw DeadlyImportError("STL: unexpected EOF while parsing facet"); + } sz += 7; SkipSpaces(&sz); sz = fast_atoreal_move(sz, (float&)vn->x ); @@ -324,6 +327,9 @@ void STLImporter::LoadASCIIFile() } else { + if (sz[6] == '\0') { + throw DeadlyImportError("STL: unexpected EOF while parsing facet"); + } sz += 7; SkipSpaces(&sz); positionBuffer.push_back(aiVector3D());