浏览代码

Merge pull request #4643 from sashashura/patch-1

Fixes Heap-buffer-overflow in SuperFastHash
Kim Kulling 3 年之前
父节点
当前提交
53a4b43ec1
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      code/AssetLib/LWS/LWSLoader.cpp

+ 3 - 0
code/AssetLib/LWS/LWSLoader.cpp

@@ -313,6 +313,9 @@ void LWSImporter::SetupNodeName(aiNode *nd, LWS::NodeDesc &src) {
             std::string::size_type t = src.path.substr(s).find_last_of('.');
 
             nd->mName.length = ::ai_snprintf(nd->mName.data, MAXLEN, "%s_(%08X)", src.path.substr(s).substr(0, t).c_str(), combined);
+            if (nd->mName.length > MAXLEN) {
+                nd->mName.length = MAXLEN;
+            }
             return;
         }
     }