From c3e69b5b8273a7b261213c4fe2a2d3c25e9a5308 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 31 May 2023 07:57:36 +0000 Subject: [PATCH] Fix Heap-buffer-overflow READ in Assimp::ObjFileParser::getFace --- code/AssetLib/Obj/ObjFileParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/Obj/ObjFileParser.cpp b/code/AssetLib/Obj/ObjFileParser.cpp index ed416dc93..38fc0533e 100644 --- a/code/AssetLib/Obj/ObjFileParser.cpp +++ b/code/AssetLib/Obj/ObjFileParser.cpp @@ -456,8 +456,8 @@ void ObjFileParser::getFace(aiPrimitiveType type) { iPos = 0; } else { //OBJ USES 1 Base ARRAYS!!!! - const char *token = &(*m_DataIt); - const int iVal = ::atoi(token); + 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 int tmp = iVal;