1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-11-29 19:04:31 +00:00
openmw/components/esm4
elsid 4186ca6ceb
Fix clang-analyzer-security.ArrayBound warning
Size of an array is not a valid index.

components/esm4/reader.cpp:925:15: error: Out of bound access to memory after the end of 'sGroupType' [clang-analyzer-security.ArrayBound,-warnings-as-errors]
  925 |         ss << sGroupType[std::min<std::size_t>(type, std::size(sGroupType))]; // avoid out of range
      |               ^
components/esm4/reader.cpp:627:13: note: Assuming field 'groupSize' is equal to field 'recHeaderSize'
  627 |         if (mCtx.recordHeader.group.groupSize == (std::uint32_t)mCtx.recHeaderSize)
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:627:9: note: Taking true branch
  627 |         if (mCtx.recordHeader.group.groupSize == (std::uint32_t)mCtx.recHeaderSize)
      |         ^
components/esm4/reader.cpp:634:17: note: Assuming the condition is true
  634 |             if (!mCtx.groupStack.empty()) // top group may be empty (e.g. HAIR in Skyrim)
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:634:13: note: Taking true branch
  634 |             if (!mCtx.groupStack.empty()) // top group may be empty (e.g. HAIR in Skyrim)
      |             ^
components/esm4/reader.cpp:638:17: note: Calling 'Reader::exitGroupCheck'
  638 |                 exitGroupCheck();
      |                 ^~~~~~~~~~~~~~~~
components/esm4/reader.cpp:650:13: note: Assuming the condition is false
  650 |         if (mCtx.groupStack.empty())
      |             ^~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:650:9: note: Taking false branch
  650 |         if (mCtx.groupStack.empty())
      |         ^
components/esm4/reader.cpp:655:16: note: Assuming 'lastGroupSize' is <= field 'second'
  655 |         while (mCtx.groupStack.back().second >= lastGroupSize)
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:655:9: note: Loop condition is true.  Entering loop body
  655 |         while (mCtx.groupStack.back().second >= lastGroupSize)
      |         ^
components/esm4/reader.cpp:663:17: note: Assuming 'overshoot' is <= 0
  663 |             if (overshoot > 0)
      |                 ^~~~~~~~~~~~~
components/esm4/reader.cpp:663:13: note: Taking false branch
  663 |             if (overshoot > 0)
      |             ^
components/esm4/reader.cpp:676:17: note: Assuming the condition is false
  676 |             if (mCtx.groupStack.empty())
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:676:13: note: Taking false branch
  676 |             if (mCtx.groupStack.empty())
      |             ^
components/esm4/reader.cpp:682:17: note: Assuming 'lastGroupSize' is >= field 'second'
  682 |             if (lastGroupSize < mCtx.groupStack.back().second)
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:682:13: note: Taking false branch
  682 |             if (lastGroupSize < mCtx.groupStack.back().second)
      |             ^
components/esm4/reader.cpp:686:17: note: Assuming 'lastGroupSize' is < field 'second'
  686 |             if (mCtx.groupStack.back().second > lastGroupSize) // FIXME: debugging only
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:686:13: note: Taking true branch
  686 |             if (mCtx.groupStack.back().second > lastGroupSize) // FIXME: debugging only
      |             ^
components/esm4/reader.cpp:687:30: note: Calling 'printLabel'
  687 |                 std::cerr << printLabel(mCtx.groupStack.back().first.label, mCtx.groupStack.back().first.type)
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
components/esm4/reader.cpp:925:15: note: Access of 'sGroupType' at index 12, while it holds only 12 'class std::basic_string_view<char>' elements
  925 |         ss << sGroupType[std::min<std::size_t>(type, std::size(sGroupType))]; // avoid out of range
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-11-25 00:03:39 +01:00
..
actor.hpp Fix formatting 2023-08-17 02:14:22 +03:00
cellgrid.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
common.hpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
dialogue.hpp Apply clang-format to code base 2022-09-22 21:35:26 +03:00
effect.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
grid.hpp Split components/esm4/common.hpp header 2023-04-04 10:12:20 +02:00
grouptype.hpp Split components/esm4/common.hpp header 2023-04-04 10:12:20 +02:00
inventory.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
lighting.hpp Avoid using ESM4::Cell with uninitialized fields 2023-05-29 22:37:25 +02:00
loadachr.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadachr.hpp Replace fixed size writeHNT calls with decomposition 2024-03-03 19:39:19 +01:00
loadacti.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadacti.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadalch.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadalch.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadaloc.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadaloc.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadammo.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadammo.hpp Maybe load FO4 ammunition records 2023-08-17 02:14:21 +03:00
loadanio.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadanio.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadappa.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadappa.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadarma.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadarma.hpp Changes required during review 2023-10-07 17:21:25 +02:00
loadarmo.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadarmo.hpp Maybe load FO4 armor records 2023-08-17 02:12:32 +03:00
loadaspc.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadaspc.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadbook.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadbook.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadbptd.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadbptd.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadcell.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadcell.hpp Split ESM headers 2024-05-03 01:55:20 +02:00
loadclas.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadclas.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadclfm.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadclfm.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadclot.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadclot.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadcont.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadcont.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadcrea.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadcrea.hpp Fix and enforce enum naming 2025-11-22 11:19:18 +01:00
loaddial.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loaddial.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loaddobj.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loaddobj.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loaddoor.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loaddoor.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadeyes.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadeyes.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadflor.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadflor.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadflst.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadflst.hpp Load FO4 form lists 2023-08-17 04:43:47 +03:00
loadfurn.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadfurn.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadglob.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadglob.hpp Bring ESM4 global variable reading up-to-date with FO76 2024-01-07 04:55:39 +03:00
loadgmst.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadgmst.hpp Support unsigned int GMSTs 2023-08-17 02:12:31 +03:00
loadgras.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadgras.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadgrup.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadhair.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadhair.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadhdpt.cpp Init potentially unread fields for HDPT 2024-08-04 18:42:39 +02:00
loadhdpt.hpp Bring ESM4 head part reading up-to-date with FO76 2024-01-07 04:55:39 +03:00
loadidle.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadidle.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadidlm.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadidlm.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadimod.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadimod.hpp Fill out ESM4::ItemMod 2023-10-30 23:23:39 +03:00
loadinfo.cpp ESM4: Make script local variable loading more reliable 2024-03-21 18:16:11 +03:00
loadinfo.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadingr.cpp Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
loadingr.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadkeym.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadkeym.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadland.cpp ESM4 landscape textures 2025-08-01 18:45:24 +02:00
loadland.hpp ESM4 landscape textures 2025-08-01 18:45:24 +02:00
loadlgtm.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadlgtm.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadligh.cpp Support ESM4::Light with no spotlight data 2024-11-24 03:12:52 +03:00
loadligh.hpp Support ESM4::Light with no spotlight data 2024-11-24 03:12:52 +03:00
loadltex.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadltex.hpp Read LTEX::INAM 2023-10-30 02:34:47 +03:00
loadlvlc.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadlvlc.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadlvli.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadlvli.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadlvln.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadlvln.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadmato.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadmato.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadmisc.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadmisc.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadmset.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadmset.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadmstt.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadmstt.hpp Maybe load FO4 moveable static records 2023-08-17 02:14:21 +03:00
loadmusc.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadmusc.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadnavi.cpp Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
loadnavi.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadnavm.cpp Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
loadnavm.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadnote.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadnote.hpp Maybe load FO4 note records 2023-08-17 02:14:22 +03:00
loadnpc.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadnpc.hpp Fix and enforce enum naming 2025-11-22 11:19:18 +01:00
loadotft.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadotft.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadpack.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadpack.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadpgrd.cpp Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
loadpgrd.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadpgre.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadpgre.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadpwat.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadpwat.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadqust.cpp Skip SLSD, SCVR, SCRV subrecords in QUST record 2025-03-15 13:11:26 +01:00
loadqust.hpp Fix and enforce enum naming 2025-11-22 11:19:18 +01:00
loadrace.cpp Check index for ESM4 race parts 2025-11-09 21:49:41 +01:00
loadrace.hpp Init an another field 2023-11-07 15:57:25 +04:00
loadrefr.cpp Fix and enforce local variable naming 2025-08-05 21:27:48 +02:00
loadrefr.hpp Replace fixed size writeHNT calls with decomposition 2024-03-03 19:39:19 +01:00
loadregn.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadregn.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadroad.cpp Merge branch 'rm_esm4_local_static' into 'master' 2024-03-21 05:28:40 +00:00
loadroad.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadsbsp.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadsbsp.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadscol.cpp Place ESM4 static collections to the scene 2024-05-09 17:26:27 +03:00
loadscol.hpp Place ESM4 static collections to the scene 2024-05-09 17:26:27 +03:00
loadscpt.cpp ESM4: Make script local variable loading more reliable 2024-03-21 18:16:11 +03:00
loadscpt.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadscrl.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadscrl.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadsgst.cpp Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
loadsgst.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadslgm.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadslgm.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadsndr.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadsndr.hpp Maybe load FO4 sound descriptor records 2023-08-17 05:30:39 +03:00
loadsoun.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadsoun.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadstat.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadstat.hpp Maybe load some FO4 static records 2023-08-17 02:12:32 +03:00
loadtact.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadtact.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadterm.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadterm.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadtes4.cpp Resolve a number of Coverity defects 2025-08-06 19:52:09 +02:00
loadtes4.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadtree.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadtree.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadtxst.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadtxst.hpp Bring ESM4 texture set reading up-to-date with FO76 2024-01-07 04:55:39 +03:00
loadweap.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadweap.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
loadwrld.cpp Get rid of ESM4::SubRecordTypes 2024-03-18 12:25:17 +03:00
loadwrld.hpp components/esm4/loadwrld.hpp: clarify comment 2024-06-11 20:19:55 -05:00
magiceffectid.hpp Split components/esm4/common.hpp header 2023-04-04 10:12:20 +02:00
reader.cpp Fix clang-analyzer-security.ArrayBound warning 2025-11-25 00:03:39 +01:00
reader.hpp Track ESM4 file loading progress 2025-01-14 20:27:02 +03:00
readerutils.hpp Split components/esm4/common.hpp header 2023-04-04 10:12:20 +02:00
records.hpp Load ESM4 actors 2023-07-26 11:47:50 +02:00
reference.hpp Replace fixed size writeHNT calls with decomposition 2024-03-03 19:39:19 +01:00
script.hpp ESM4: Make script local variable loading more reliable 2024-03-21 18:16:11 +03:00
typetraits.hpp Refactor components/esm4 2023-08-05 13:12:24 +02:00
vertex.hpp Split components/esm4/common.hpp header 2023-04-04 10:12:20 +02:00