Fix potential security issues.

This commit is contained in:
Kim Kulling
2019-02-05 22:05:52 +01:00
parent 0f8f1449a1
commit 6e39c22554
7 changed files with 41 additions and 54 deletions

View File

@@ -184,8 +184,13 @@ static std::string encodeXML(const std::string& data) {
static
void WriteDump(const aiScene* scene, IOStream* io, bool shortened) {
time_t tt = ::time( NULL );
tm* p = ::gmtime( &tt );
ai_assert( nullptr != p );
#if _WIN32
tm* p = gmtime(&tt);
#else
struct tm now;
tm* p = gmtime_r(&tt, &now);
#endif
ai_assert(nullptr != p);
// write header
std::string header(