From 99c34961b9d48ef25113e7d8b1827cdf88cb0a5d Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sun, 18 Sep 2016 21:37:31 +0200 Subject: [PATCH 01/14] Covery: 152484 Buffer not null terminated --- test/unit/utBlenderIntermediate.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unit/utBlenderIntermediate.cpp b/test/unit/utBlenderIntermediate.cpp index 0bf40936b..eea30e202 100644 --- a/test/unit/utBlenderIntermediate.cpp +++ b/test/unit/utBlenderIntermediate.cpp @@ -48,10 +48,13 @@ class BlenderIntermediateTest : public ::testing::Test { // empty }; +#define NAME_1 "name1" +#define NAME_2 "name2" + TEST_F( BlenderIntermediateTest,ConversionData_ObjectCompareTest ) { Object obj1, obj2; - strncpy( obj1.id.name, "name1", 5 ); - strncpy( obj2.id.name, "name2", 5 ); + strncpy( obj1.id.name, NAME_1, sizeof(NAME_1) ); + strncpy( obj2.id.name, NAME_2, sizeof(NAME_2) ); Blender::ObjectCompare cmp_false; bool res( cmp_false( &obj1, &obj2 ) ); EXPECT_FALSE( res ); From 96fab1cf55dc8cdfec3d5705b8ceabb9deb10e0e Mon Sep 17 00:00:00 2001 From: wise86Android Date: Mon, 19 Sep 2016 22:23:13 +0200 Subject: [PATCH 02/14] 122219-122218 Big parameter passed by value --- code/XFileExporter.cpp | 2 +- code/XFileExporter.h | 2 +- include/assimp/metadata.h | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/XFileExporter.cpp b/code/XFileExporter.cpp index 8d5e75d3e..e3a46a1da 100644 --- a/code/XFileExporter.cpp +++ b/code/XFileExporter.cpp @@ -513,7 +513,7 @@ std::string XFileExporter::toXFileString(aiString &name) return str; } -void XFileExporter::writePath(aiString path) +void XFileExporter::writePath(const aiString &path) { std::string str = std::string(path.C_Str()); BaseImporter::ConvertUTF8toISO8859_1(str); diff --git a/code/XFileExporter.h b/code/XFileExporter.h index c33de3347..389c7010c 100644 --- a/code/XFileExporter.h +++ b/code/XFileExporter.h @@ -107,7 +107,7 @@ protected: const ExportProperties* mProperties; /// write a path - void writePath(aiString path); + void writePath(const aiString &path); /// The IOSystem for output IOSystem* mIOSystem; diff --git a/include/assimp/metadata.h b/include/assimp/metadata.h index 258bf329c..291162137 100644 --- a/include/assimp/metadata.h +++ b/include/assimp/metadata.h @@ -105,13 +105,13 @@ struct aiMetadataEntry * Helper functions to get the aiType enum entry for a type */ // ------------------------------------------------------------------------------- -inline aiMetadataType GetAiType( bool ) { return AI_BOOL; } -inline aiMetadataType GetAiType( int ) { return AI_INT; } -inline aiMetadataType GetAiType( uint64_t ) { return AI_UINT64; } -inline aiMetadataType GetAiType( float ) { return AI_FLOAT; } -inline aiMetadataType GetAiType( double ) { return AI_DOUBLE; } -inline aiMetadataType GetAiType( aiString ) { return AI_AISTRING; } -inline aiMetadataType GetAiType( aiVector3D ) { return AI_AIVECTOR3D; } +inline aiMetadataType GetAiType( const bool& ) { return AI_BOOL; } +inline aiMetadataType GetAiType( const int& ) { return AI_INT; } +inline aiMetadataType GetAiType( const uint64_t& ) { return AI_UINT64; } +inline aiMetadataType GetAiType( const float& ) { return AI_FLOAT; } +inline aiMetadataType GetAiType( const double& ) { return AI_DOUBLE; } +inline aiMetadataType GetAiType( const aiString& ) { return AI_AISTRING; } +inline aiMetadataType GetAiType( const aiVector3D& ) { return AI_AIVECTOR3D; } From 04e0552f9eda6b9efe952bd34db8fa841fc239ce Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 12:33:53 +0200 Subject: [PATCH 03/14] 134062 Use after free --- code/MakeVerboseFormat.cpp | 4 +++- test/unit/utCoverityTest.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/unit/utCoverityTest.cpp diff --git a/code/MakeVerboseFormat.cpp b/code/MakeVerboseFormat.cpp index df3b97a4d..be68bf3d6 100644 --- a/code/MakeVerboseFormat.cpp +++ b/code/MakeVerboseFormat.cpp @@ -168,6 +168,8 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh) } } + + // build output vertex weights for (unsigned int i = 0;i < pcMesh->mNumBones;++i) { @@ -177,11 +179,11 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh) aiVertexWeight *weightToCopy = &( newWeights[i][0] ); memcpy(pcMesh->mBones[i]->mWeights, weightToCopy, sizeof(aiVertexWeight) * newWeights[i].size()); - delete[] newWeights; } else { pcMesh->mBones[i]->mWeights = NULL; } } + delete[] newWeights; // delete the old members delete[] pcMesh->mVertices; diff --git a/test/unit/utCoverityTest.cpp b/test/unit/utCoverityTest.cpp new file mode 100644 index 000000000..eedfdf963 --- /dev/null +++ b/test/unit/utCoverityTest.cpp @@ -0,0 +1,4 @@ +// +// Created by wise on 9/24/16. +// + From 61097479c87a98da8acb80ec7e9916c888b53d51 Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 15:55:37 +0200 Subject: [PATCH 04/14] 122243 Resource leak --- code/MDLMaterialLoader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/MDLMaterialLoader.cpp b/code/MDLMaterialLoader.cpp index a84afad22..3425d7b09 100644 --- a/code/MDLMaterialLoader.cpp +++ b/code/MDLMaterialLoader.cpp @@ -488,7 +488,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( unsigned int iWidth, unsigned int iHeight) { - aiTexture* pcNew = NULL; + aiTexture* pcNew = nullptr; // get the type of the skin unsigned int iMasked = (unsigned int)(iType & 0xF); @@ -522,7 +522,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( memcpy(pcNew->pcData,szCurrent,pcNew->mWidth); szCurrent += iWidth; } - if (0x7 == iMasked) + else if (0x7 == iMasked) { // ***** REFERENCE TO EXTERNAL FILE ***** if (1 != iHeight) @@ -546,6 +546,9 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( else if (iMasked || !iType || (iType && iWidth && iHeight)) { // ***** STANDARD COLOR TEXTURE ***** + if(pcNew!= nullptr) + delete pcNew; + pcNew = new aiTexture(); if (!iHeight || !iWidth) { From 3f53ffa5767da601e6f35092a042136cf095a616 Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 16:27:40 +0200 Subject: [PATCH 05/14] 122243,122194 Resource leak --- code/HMPLoader.cpp | 13 ++++++++----- code/MDLLoader.cpp | 6 +++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/code/HMPLoader.cpp b/code/HMPLoader.cpp index 560852691..788286e12 100644 --- a/code/HMPLoader.cpp +++ b/code/HMPLoader.cpp @@ -127,8 +127,7 @@ void HMPImporter::InternReadFile( const std::string& pFile, throw DeadlyImportError( "HMP File is too small."); // Allocate storage and copy the contents of the file to a memory buffer - std::vector buffer(fileSize); - mBuffer = &buffer[0]; + mBuffer = new uint8_t[fileSize]; file->Read( (void*)mBuffer, 1, fileSize); iFileSize = (unsigned int)fileSize; @@ -174,7 +173,9 @@ void HMPImporter::InternReadFile( const std::string& pFile, // Set the AI_SCENE_FLAGS_TERRAIN bit pScene->mFlags |= AI_SCENE_FLAGS_TERRAIN; - // File buffer destructs automatically now + delete[] mBuffer; + mBuffer= nullptr; + } // ------------------------------------------------------------------------------------------------ @@ -449,11 +450,13 @@ void HMPImporter::ReadFirstSkin(unsigned int iNumSkins, const unsigned char* szC // read the type of the skin ... // sometimes we need to skip 12 bytes here, I don't know why ... - uint32_t iType = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t); + uint32_t iType = *((uint32_t*)szCursor); + szCursor += sizeof(uint32_t); if (0 == iType) { szCursor += sizeof(uint32_t) * 2; - iType = *((uint32_t*)szCursor);szCursor += sizeof(uint32_t); + iType = *((uint32_t*)szCursor); + szCursor += sizeof(uint32_t); if (!iType) throw DeadlyImportError("Unable to read HMP7 skin chunk"); diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index ba5c4c32c..7cad7dbe4 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -172,8 +172,7 @@ void MDLImporter::InternReadFile( const std::string& pFile, } // Allocate storage and copy the contents of the file to a memory buffer - std::vector buffer(iFileSize+1); - mBuffer = &buffer[0]; + mBuffer =new unsigned char[iFileSize+1]; file->Read( (void*)mBuffer, 1, iFileSize); // Append a binary zero to the end of the buffer. @@ -239,7 +238,8 @@ void MDLImporter::InternReadFile( const std::string& pFile, 0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,0.f,1.f); // delete the file buffer and cleanup - AI_DEBUG_INVALIDATE_PTR(mBuffer); + delete [] mBuffer; + mBuffer= nullptr; AI_DEBUG_INVALIDATE_PTR(pIOHandler); AI_DEBUG_INVALIDATE_PTR(pScene); } From 4872c4caf835e97276863a0f547417c59d7dd9bb Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 19:19:48 +0200 Subject: [PATCH 06/14] 122238 Use after free --- code/BlenderScene.cpp | 2 +- code/IRRMeshLoader.cpp | 46 +++++++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/code/BlenderScene.cpp b/code/BlenderScene.cpp index 8d6e96eb5..f671da20e 100644 --- a/code/BlenderScene.cpp +++ b/code/BlenderScene.cpp @@ -806,4 +806,4 @@ void DNA::RegisterConverters() { } -#endif ASSIMP_BUILD_NO_BLEND_IMPORTER +#endif //ASSIMP_BUILD_NO_BLEND_IMPORTER diff --git a/code/IRRMeshLoader.cpp b/code/IRRMeshLoader.cpp index a06449dca..853ead15f 100644 --- a/code/IRRMeshLoader.cpp +++ b/code/IRRMeshLoader.cpp @@ -116,14 +116,18 @@ const aiImporterDesc* IRRMeshImporter::GetInfo () const return &desc; } -static void releaseMaterial( aiMaterial *mat ) { - delete mat; - mat = nullptr; +static void releaseMaterial( aiMaterial **mat ) { + if(*mat!= nullptr) { + delete *mat; + *mat = nullptr; + } } -static void releaseMesh( aiMesh *mesh ) { - delete mesh; - mesh = nullptr; +static void releaseMesh( aiMesh **mesh ) { + if (*mesh != nullptr){ + delete *mesh; + *mesh = nullptr; + } } // ------------------------------------------------------------------------------------------------ @@ -148,8 +152,8 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, meshes.reserve(5); // temporary data - current mesh buffer - aiMaterial* curMat = NULL; - aiMesh* curMesh = NULL; + aiMaterial* curMat = nullptr; + aiMesh* curMesh = nullptr; unsigned int curMatFlags = 0; std::vector curVertices,curNormals,curTangents,curBitangents; @@ -170,14 +174,14 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, // end of previous buffer. A material and a mesh should be there if ( !curMat || !curMesh) { DefaultLogger::get()->error("IRRMESH: A buffer must contain a mesh and a material"); - releaseMaterial( curMat ); - releaseMesh( curMesh ); + releaseMaterial( &curMat ); + releaseMesh( &curMesh ); } else { materials.push_back(curMat); meshes.push_back(curMesh); } - curMat = NULL; - curMesh = NULL; + curMat = nullptr; + curMesh = nullptr; curVertices.clear(); curColors.clear(); @@ -192,7 +196,7 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, if (!ASSIMP_stricmp(reader->getNodeName(),"material")) { if (curMat) { DefaultLogger::get()->warn("IRRMESH: Only one material description per buffer, please"); - releaseMaterial( curMat ); + releaseMaterial( &curMat ); } curMat = ParseMaterial(curMatFlags); } @@ -204,8 +208,8 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, // This is possible ... remove the mesh from the list and skip further reading DefaultLogger::get()->warn("IRRMESH: Found mesh with zero vertices"); - releaseMaterial( curMat ); - releaseMesh( curMesh ); + releaseMaterial( &curMat ); + releaseMesh( &curMesh ); textMeaning = 0; continue; } @@ -248,7 +252,7 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, vertexFormat = 2; } else if (ASSIMP_stricmp("standard", t)) { - releaseMaterial( curMat ); + releaseMaterial( &curMat ); DefaultLogger::get()->warn("IRRMESH: Unknown vertex format"); } else vertexFormat = 0; @@ -256,7 +260,7 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, } else if (!ASSIMP_stricmp(reader->getNodeName(),"indices")) { if (curVertices.empty() && curMat) { - releaseMaterial( curMat ); + releaseMaterial( &curMat ); throw DeadlyImportError("IRRMESH: indices must come after vertices"); } @@ -272,10 +276,10 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, DefaultLogger::get()->warn("IRRMESH: Found mesh with zero indices"); // mesh - away - releaseMesh( curMesh ); + releaseMesh( &curMesh ); // material - away - releaseMaterial( curMat ); + releaseMaterial( &curMat ); textMeaning = 0; continue; @@ -487,8 +491,8 @@ void IRRMeshImporter::InternReadFile( const std::string& pFile, if (curMat || curMesh) { if ( !curMat || !curMesh) { DefaultLogger::get()->error("IRRMESH: A buffer must contain a mesh and a material"); - releaseMaterial( curMat ); - releaseMesh( curMesh ); + releaseMaterial( &curMat ); + releaseMesh( &curMesh ); } else { materials.push_back(curMat); From 93d9b199950794b2ac562324f14c90cfb2e2ac8b Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 19:22:10 +0200 Subject: [PATCH 07/14] remove unused unit test --- test/unit/utCoverityTest.cpp | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 test/unit/utCoverityTest.cpp diff --git a/test/unit/utCoverityTest.cpp b/test/unit/utCoverityTest.cpp deleted file mode 100644 index eedfdf963..000000000 --- a/test/unit/utCoverityTest.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// -// Created by wise on 9/24/16. -// - From 5bec41ad1666f95c268fed30d71612571e38aeeb Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 20:11:07 +0200 Subject: [PATCH 08/14] 122198 Resource leak --- code/NDOLoader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/NDOLoader.cpp b/code/NDOLoader.cpp index f04eb5345..de682e260 100644 --- a/code/NDOLoader.cpp +++ b/code/NDOLoader.cpp @@ -257,7 +257,8 @@ void NDOImporter::InternReadFile( const std::string& pFile, } aiMesh* mesh = new aiMesh(); - aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces=face_table.size()]; + mesh->mNumFaces=face_table.size(); + aiFace* faces = mesh->mFaces = new aiFace[mesh->mNumFaces]; vertices.clear(); vertices.reserve(4 * face_table.size()); // arbitrarily chosen @@ -298,7 +299,8 @@ void NDOImporter::InternReadFile( const std::string& pFile, pScene->mMeshes[pScene->mNumMeshes] = mesh; (nd->mMeshes = new unsigned int[nd->mNumMeshes=1])[0]=pScene->mNumMeshes++; - } + }else + delete mesh; } } From 94538e9d8774d3b2252b7f1305cfe4bacc901c48 Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 20:19:43 +0200 Subject: [PATCH 09/14] 122193 Uninitialized scalar variable --- code/LWOLoader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/LWOLoader.cpp b/code/LWOLoader.cpp index 222ec8e2c..df2cab7bc 100644 --- a/code/LWOLoader.cpp +++ b/code/LWOLoader.cpp @@ -1058,8 +1058,6 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly) LWO::PointList& pointList = mCurLayer->mTempPoints; LWO::ReferrerList& refList = mCurLayer->mPointReferrers; - float temp[4]; - const unsigned int numPoints = (unsigned int)pointList.size(); const unsigned int numFaces = (unsigned int)list.size(); @@ -1123,10 +1121,12 @@ void LWOImporter::LoadLWO2VertexMap(unsigned int length, bool perPoly) } } } + + std::unique_ptr temp(new float[type]); for (unsigned int l = 0; l < type;++l) temp[l] = GetF4(); - DoRecursiveVMAPAssignment(base,type,idx, temp); + DoRecursiveVMAPAssignment(base,type,idx, temp.get()); mFileBuffer += diff; } } From 33dcf4dbd3cc15629efcfcd17639c47ae31973a3 Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 20:24:38 +0200 Subject: [PATCH 10/14] 122185 Pointer to local outside scope --- code/FBXConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 1f6274d8f..884493259 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1394,9 +1394,9 @@ unsigned int Converter::ConvertMeshMultiMaterial( const MeshGeometry& mesh, cons // allocate tangents, binormals. const std::vector& tangents = mesh.GetTangents(); const std::vector* binormals = &mesh.GetBinormals(); + std::vector tempBinormals; if ( tangents.size() ) { - std::vector tempBinormals; if ( !binormals->size() ) { if ( normals.size() ) { // XXX this computes the binormals for the entire mesh, not only From 08da6b278d5c22522194bce6d8b8ce3b9a02faba Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 20:29:49 +0200 Subject: [PATCH 11/14] 122180 Resource leak --- code/IRRLoader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/IRRLoader.cpp b/code/IRRLoader.cpp index a1cfaf28b..2c82b43e4 100644 --- a/code/IRRLoader.cpp +++ b/code/IRRLoader.cpp @@ -269,14 +269,15 @@ void IRRImporter::CopyMaterial(std::vector& materials, if (UINT_MAX == defMatIdx) { defMatIdx = (unsigned int)materials.size(); - aiMaterial* mat = new aiMaterial(); + //TODO: add this materials to someone? + /*aiMaterial* mat = new aiMaterial(); aiString s; s.Set(AI_DEFAULT_MATERIAL_NAME); mat->AddProperty(&s,AI_MATKEY_NAME); aiColor3D c(0.6f,0.6f,0.6f); - mat->AddProperty(&c,1,AI_MATKEY_COLOR_DIFFUSE); + mat->AddProperty(&c,1,AI_MATKEY_COLOR_DIFFUSE);*/ } mesh->mMaterialIndex = defMatIdx; return; From 07ec476b7d3b13fae1ce3ae8ed432ef43c9d6fe9 Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sat, 24 Sep 2016 21:17:55 +0200 Subject: [PATCH 12/14] 122143,122139 Copy into fixed size buffer --- code/MDLLoader.cpp | 2 +- code/SMDLoader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index 7cad7dbe4..3e0e91f6c 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -1557,7 +1557,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( ) } else { pcNode->mName.length = ::strlen(szBuffer); } - ::strcpy(pcNode->mName.data,szBuffer); + ::strncpy(pcNode->mName.data,szBuffer,MAXLEN); ++p; } } diff --git a/code/SMDLoader.cpp b/code/SMDLoader.cpp index 2db9f15e7..a868d9cb0 100644 --- a/code/SMDLoader.cpp +++ b/code/SMDLoader.cpp @@ -660,7 +660,7 @@ void SMDImporter::CreateOutputMaterials() if (aszTextures[iMat].length()) { - ::strcpy(szName.data, aszTextures[iMat].c_str() ); + ::strncpy(szName.data, aszTextures[iMat].c_str(),MAXLEN ); szName.length = aszTextures[iMat].length(); pcMat->AddProperty(&szName,AI_MATKEY_TEXTURE_DIFFUSE(0)); } From 8e9c0235d38f3819304f8ff2126f3ff75332bb3f Mon Sep 17 00:00:00 2001 From: wise86Android Date: Sun, 25 Sep 2016 15:21:30 +0200 Subject: [PATCH 13/14] 153083/2 Buffer not null terminated --- code/MDLLoader.cpp | 2 +- code/SMDLoader.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/MDLLoader.cpp b/code/MDLLoader.cpp index 3e0e91f6c..f82e7abfe 100644 --- a/code/MDLLoader.cpp +++ b/code/MDLLoader.cpp @@ -1557,7 +1557,7 @@ void MDLImporter::InternReadFile_3DGS_MDL7( ) } else { pcNode->mName.length = ::strlen(szBuffer); } - ::strncpy(pcNode->mName.data,szBuffer,MAXLEN); + ::strncpy(pcNode->mName.data,szBuffer,MAXLEN-1); ++p; } } diff --git a/code/SMDLoader.cpp b/code/SMDLoader.cpp index a868d9cb0..b06fa8c96 100644 --- a/code/SMDLoader.cpp +++ b/code/SMDLoader.cpp @@ -641,7 +641,7 @@ void SMDImporter::ComputeAbsoluteBoneTransformations() bone.mOffsetMatrix.Inverse(); } } - +\ // ------------------------------------------------------------------------------------------------ // create output materials void SMDImporter::CreateOutputMaterials() @@ -660,7 +660,7 @@ void SMDImporter::CreateOutputMaterials() if (aszTextures[iMat].length()) { - ::strncpy(szName.data, aszTextures[iMat].c_str(),MAXLEN ); + ::strncpy(szName.data, aszTextures[iMat].c_str(),MAXLEN-1); szName.length = aszTextures[iMat].length(); pcMat->AddProperty(&szName,AI_MATKEY_TEXTURE_DIFFUSE(0)); } From dc3875b8f29d38e45e403ea94636647a821d419c Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sat, 19 Nov 2016 11:48:39 +0100 Subject: [PATCH 14/14] Travis: fix typo. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a5b8cbf61..ac8ca4a10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,4 +50,4 @@ after_success: - lcov --directory . --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' 'contrib/*' 'test/*' --output-file coverage.info - lcov --list coverage.info - - coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info + - coveralls-lcov --repo-token=${COVERALLS_TOKEN} coverage.info