Adjust warn

This commit is contained in:
Malcolm Tyrrell
2021-05-12 12:43:24 +01:00
parent 8b13223314
commit 813d0aecdd
4 changed files with 21 additions and 16 deletions

View File

@@ -197,13 +197,14 @@ void Logger::info(const char *message) {
}
// ----------------------------------------------------------------------------------
void Logger::warn(const char *message) {
void Logger::warnInternal(Assimp::Formatter::format f) {
std::string message = f;
// TODO: Should limit sizes in the formatter.
// SECURITY FIX: see above
if (strlen(message) > MAX_LOG_MESSAGE_LENGTH) {
if (message.length() > MAX_LOG_MESSAGE_LENGTH) {
return;
}
return OnWarn(message);
return OnWarn(message.c_str());
}
// ----------------------------------------------------------------------------------