assimp-5.4.3-1.fc43

List of Findings

Error: CPPCHECK_WARNING (CWE-562): [#def1]
assimp-5.4.3/code/AssetLib/3DS/3DSLoader.cpp:150: error[danglingLifetime]: Non-local variable 'mCurrentNode' will use pointer to local variable '_rootNode'.
#  148|       D3DS::Node _rootNode("UNNAMED");
#  149|       mLastNodeIndex = -1;
#  150|->     mCurrentNode = &_rootNode;
#  151|       mRootNode = mCurrentNode;
#  152|       mRootNode->mHierarchyPos = -1;

Error: CPPCHECK_WARNING (CWE-562): [#def2]
assimp-5.4.3/code/AssetLib/3DS/3DSLoader.cpp:154: error[danglingLifetime]: Non-local variable 'mRootNode' will use pointer to local variable '_rootNode'.
#  152|       mRootNode->mHierarchyPos = -1;
#  153|       mRootNode->mHierarchyIndex = -1;
#  154|->     mRootNode->mParent = nullptr;
#  155|       mMasterScale = 1.0f;
#  156|       mBackgroundImage = std::string();

Error: CPPCHECK_WARNING: [#def3]
assimp-5.4.3/code/AssetLib/ASE/ASEParser.h:79: error[internalError]: Analysis failed (variable without scope). If the code is valid then please report this failure.
#   77|       }
#   78|   
#   79|->     Material(const Material &other) = default;
#   80|   
#   81|       Material &operator=(const Material &other) {

Error: COMPILER_WARNING: [#def4]
assimp-5.4.3/code/AssetLib/COB/COBLoader.cpp: scope_hint: In member function ‘BuildNodes’
assimp-5.4.3/code/AssetLib/COB/COBLoader.cpp:247:73: warning[-Walloc-size-larger-than=]: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807
#  247 |                     outmesh->mFaces = new aiFace[reflist.second.size()]();
#      |                                                                         ^
/usr/include/c++/15/new:140:26: note: in a call to allocation function ‘operator new []’ declared here
#  140 | _GLIBCXX_NODISCARD void* operator new[](std::size_t)
#      |                          ^
#  245|                       outmesh->mTextureCoords[0] = new aiVector3D[n];
#  246|   
#  247|->                     outmesh->mFaces = new aiFace[reflist.second.size()]();
#  248|                       for (Face *f : reflist.second) {
#  249|                           if (f->indices.empty()) {

Error: CPPCHECK_WARNING (CWE-398): [#def5]
assimp-5.4.3/code/AssetLib/COB/COBLoader.cpp:850: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  848|               } catch (const DeadlyImportError &) {
#  849|                   // out of limit so correct the value
#  850|->                 reader.IncPtr(reader.GetReadLimit());
#  851|               }
#  852|           }

Error: CPPCHECK_WARNING (CWE-562): [#def6]
assimp-5.4.3/code/AssetLib/HMP/HMPLoader.cpp:121: error[danglingLifetime]: Non-local variable 'mBuffer' will use pointer to local variable 'buffer'.
#  119|       std::unique_ptr<uint8_t[], decltype(deleter)> buffer(new uint8_t[fileSize], deleter);
#  120|       mBuffer = buffer.get();
#  121|->     file->Read((void *)mBuffer, 1, fileSize);
#  122|       iFileSize = (unsigned int)fileSize;
#  123|   

Error: CPPCHECK_WARNING (CWE-457): [#def7]
assimp-5.4.3/code/AssetLib/IFC/IFCGeometry.cpp:180: warning[uninitvar]: Uninitialized variable: outer_vit
#  178|       temp.mVerts.reserve(outer_polygon_size);
#  179|       temp.mVertcnt.push_back(static_cast<unsigned int>(outer_polygon_size));
#  180|->     std::copy(outer_vit, outer_vit+outer_polygon_size,
#  181|           std::back_inserter(temp.mVerts));
#  182|   

Error: CPPCHECK_WARNING (CWE-562): [#def8]
assimp-5.4.3/code/AssetLib/MDC/MDCLoader.cpp:210: error[danglingLifetime]: Non-local variable 'mBuffer' will use pointer to local variable 'mBuffer2'.
#  208|       std::vector<unsigned char> mBuffer2(fileSize);
#  209|       file->Read(&mBuffer2[0], 1, fileSize);
#  210|->     mBuffer = &mBuffer2[0];
#  211|   
#  212|       // validate the file header

Error: CPPCHECK_WARNING (CWE-562): [#def9]
assimp-5.4.3/code/AssetLib/MDC/MDCLoader.cpp:213: error[danglingLifetime]: Non-local variable 'mBuffer' will use pointer to local variable 'mBuffer2'.
#  211|   
#  212|       // validate the file header
#  213|->     this->pcHeader = (BE_NCONST MDC::Header *)this->mBuffer;
#  214|       this->ValidateHeader();
#  215|   

Error: COMPILER_WARNING: [#def10]
assimp-5.4.3/code/AssetLib/MMD/MMDCpp14.h:75:39: warning[-Walloc-size-larger-than=]: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807
#   75 |             return std::unique_ptr<T>(new U[n]());
#      |                                       ^
/usr/include/c++/15/new: scope_hint: In member function ‘InternReadFile’
/usr/include/c++/15/new:140:26: note: in a call to allocation function ‘operator new []’ declared here
#  140 | _GLIBCXX_NODISCARD void* operator new[](std::size_t)
#      |                          ^
#   73|           make_unique(size_t n) {
#   74|               typedef typename std::remove_extent<T>::type U;
#   75|->             return std::unique_ptr<T>(new U[n]());
#   76|           }
#   77|   

Error: COMPILER_WARNING: [#def11]
assimp-5.4.3/code/AssetLib/glTF2/glTF2Importer.cpp: scope_hint: In member function ‘ImportMeshes’
assimp-5.4.3/code/AssetLib/glTF2/glTF2Importer.cpp:729:56: warning[-Walloc-size-larger-than=]: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807
#  729 |                     facePtr = faces = new aiFace[nFaces];
#      |                                                        ^
/usr/include/c++/15/new:140:26: note: in a call to allocation function ‘operator new []’ declared here
#  140 | _GLIBCXX_NODISCARD void* operator new[](std::size_t)
#      |                          ^
#  727|                           count = nFaces * 2;
#  728|                       }
#  729|->                     facePtr = faces = new aiFace[nFaces];
#  730|                       for (unsigned int i = 0; i < count; i += 2) {
#  731|                           SetFaceAndAdvance2(facePtr, aim->mNumVertices, indexBuffer[i], indexBuffer[i + 1]);

Error: CPPCHECK_WARNING (CWE-664): [#def12]
assimp-5.4.3/code/Common/SceneCombiner.cpp:760: error[mismatchingContainers]: Iterators of different containers '(*boneIt).pSrcBones' and 'boneIt->pSrcBones' are used together.
#  758|           // And copy the final weights - adjust the vertex IDs by the
#  759|           // face index offset of the corresponding mesh.
#  760|->         for (std::vector<BoneSrcIndex>::const_iterator wmit = (*boneIt).pSrcBones.begin(); wmit != (*boneIt).pSrcBones.end(); ++wmit) {
#  761|               if (wmit == wend) {
#  762|                   break;

Error: CPPCHECK_WARNING (CWE-476): [#def13]
assimp-5.4.3/code/Common/ZipArchiveIOSystem.cpp:132: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: disk_filename
#  130|   
#  131|       char *disk_filename = (char*)malloc(io_stream->m_Filename.length() + 1);
#  132|->     strncpy(disk_filename, io_stream->m_Filename.c_str(), io_stream->m_Filename.length() + 1);
#  133|       for (i = (int)io_stream->m_Filename.length() - 1; i >= 0; i -= 1)
#  134|       {

Error: CPPCHECK_WARNING (CWE-476): [#def14]
assimp-5.4.3/code/Common/ZipArchiveIOSystem.cpp:135: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: disk_filename
#  133|       for (i = (int)io_stream->m_Filename.length() - 1; i >= 0; i -= 1)
#  134|       {
#  135|->         if (disk_filename[i] != '.')
#  136|               continue;
#  137|           snprintf(&disk_filename[i], io_stream->m_Filename.length() - size_t(i), ".z%02u", number_disk + 1);

Error: CPPCHECK_WARNING (CWE-758): [#def15]
assimp-5.4.3/contrib/Open3DGC/o3dgcArithmeticCodec.h:228: error[shiftTooManyBits]: Shifting 32-bit value by 4294967295 bits is undefined behaviour
#  226|                              while (k--) // next binary part
#  227|                              {
#  228|->                                encode((signed short)((symbol>>k)&1), bModel0);
#  229|                              }
#  230|                              break;

Error: CPPCHECK_WARNING (CWE-404): [#def16]
assimp-5.4.3/contrib/Open3DGC/o3dgcBinaryStream.h:385: error[resourceLeak]: Resource leak: fin
#  383|                                       if (nread != size)
#  384|                                       {
#  385|->                                         return O3DGC_ERROR_READ_FILE;
#  386|                                       }
#  387|                                       fclose(fin);

Error: CPPCHECK_WARNING (CWE-562): [#def17]
assimp-5.4.3/contrib/googletest/googletest/include/gtest/gtest-matchers.h:718: error[returnReference]: Reference to local variable returned.
#  716|     template <typename T>
#  717|     static const T& Unwrap(std::reference_wrapper<T> v) {
#  718|->     return v;
#  719|     }
#  720|   

Error: CPPCHECK_WARNING (CWE-664): [#def18]
assimp-5.4.3/contrib/googletest/googletest/include/gtest/internal/gtest-param-util.h:155: error[mismatchingContainers]: Iterators of different containers 'impl_' and 'other.impl_' are used together.
#  153|     }
#  154|     bool operator==(const ParamIterator& other) const {
#  155|->     return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
#  156|     }
#  157|     bool operator!=(const ParamIterator& other) const {

Error: CPPCHECK_WARNING (CWE-457): [#def19]
assimp-5.4.3/contrib/unzip/unzip.c:518: warning[uninitvar]: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file
#  516|           fill_fopen64_filefunc(&us.z_filefunc.zfile_func64);
#  517|       else
#  518|->         us.z_filefunc = *pzlib_filefunc64_32_def;
#  519|       us.is64bitOpenFunction = is64bitOpenFunction;
#  520|   

Error: COMPILER_WARNING: [#def20]
assimp-5.4.3/contrib/zip/src/zip.c:44: included_from: Included from here.
assimp-5.4.3/contrib/zip/src/miniz.h:5108:9: note: ‘#pragma message: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.’
# 5106|   
# 5107|   #else
# 5108|-> #pragma message(                                                               \
# 5109|       "Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
# 5110|   #ifndef MINIZ_NO_TIME

Error: GCC_ANALYZER_WARNING (CWE-835): [#def21]
assimp-5.4.3/contrib/zlib/gzread.c:233:16: warning[-Wanalyzer-infinite-loop]: infinite loop
assimp-5.4.3/contrib/zlib/gzread.c:539:16: enter_function: entry to ‘gzgets’
#  231|   
#  232|       do {
#  233|->         switch(state->how) {
#  234|           case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */
#  235|               if (gz_look(state) == -1)

Error: CPPCHECK_WARNING (CWE-457): [#def22]
assimp-5.4.3/contrib/zlib/inflate.c:1453: warning[uninitvar]: Uninitialized variable: buf
# 1451|           }
# 1452|           state->have = 0;
# 1453|->         syncsearch(&(state->have), buf, len);
# 1454|       }
# 1455|   

Error: CPPCHECK_WARNING (CWE-476): [#def23]
assimp-5.4.3/test/unit/utColladaImportExport.cpp:157: warning[nullPointer]: Possible null pointer dereference: itemArray
#  155|       static inline void CheckUniqueIds(IdNameMap &itemIdMap, unsigned int itemCount, T **itemArray) {
#  156|           for (size_t idx = 0; idx < itemCount; ++idx) {
#  157|->             IdNameString namePair = GetItemIdName(itemArray[idx], idx);
#  158|               ReportDuplicate(itemIdMap, namePair, typeid(T).name());
#  159|           }

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-207.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameassimp-5.4.3-1.fc43
store-results-to/tmp/tmp19v2u07h/assimp-5.4.3-1.fc43.tar.xz
time-created2025-04-25 12:08:04
time-finished2025-04-25 12:15:11
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp19v2u07h/assimp-5.4.3-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp19v2u07h/assimp-5.4.3-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9