Fix Heap-buffer-overflow READ in Assimp::ObjFileParser::getFace

pull/5111/head
Alex 2023-05-31 07:57:36 +00:00
parent bee751b5f9
commit c3e69b5b82
1 changed files with 2 additions and 2 deletions

View File

@ -456,8 +456,8 @@ void ObjFileParser::getFace(aiPrimitiveType type) {
iPos = 0; iPos = 0;
} else { } else {
//OBJ USES 1 Base ARRAYS!!!! //OBJ USES 1 Base ARRAYS!!!!
const char *token = &(*m_DataIt); std::string number(&(*m_DataIt), m_DataItEnd - m_DataIt);
const int iVal = ::atoi(token); 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;