Fixes Heap-buffer-overflow in Assimp::ObjFileParser::getFace

pull/4646/head
sashashura 2022-07-16 13:50:54 +01:00 committed by GitHub
parent 0a9a23a056
commit 772cfdc757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -458,7 +458,8 @@ void ObjFileParser::getFace(aiPrimitiveType type) {
iPos = 0; iPos = 0;
} else { } else {
//OBJ USES 1 Base ARRAYS!!!! //OBJ USES 1 Base ARRAYS!!!!
const int iVal(::atoi(&(*m_DataIt))); std::string number(&(*m_DataIt), m_DataItEnd - m_DataIt);
const int iVal(::atoi(number.c_str()));
// increment iStep position based off of the sign and # of digits // increment iStep position based off of the sign and # of digits
int tmp = iVal; int tmp = iVal;