Fixes Heap-buffer-overflow in SuperFastHash

This commit is contained in:
sashashura
2022-07-16 13:44:46 +01:00
committed by GitHub
parent 0a9a23a056
commit 0c07ea7c71
+3
View File
@@ -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;
}
}