From 9c32465358c2edd33b137886b3a65077d9cf5d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Feb 2025 23:16:27 +0100 Subject: [PATCH 1/2] Correctly allocate a Gib Fixed issues found by PVS-Studio --- Source/Activities/GibEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Activities/GibEditor.cpp b/Source/Activities/GibEditor.cpp index 66140b9fc..50ff6ebfc 100644 --- a/Source/Activities/GibEditor.cpp +++ b/Source/Activities/GibEditor.cpp @@ -632,7 +632,7 @@ void GibEditor::StuffEditedGibs(MOSRotating* pEditedObject) { // Take each proxy object and stuff it into a Gib instance which then gets stuffed into the object to be saved std::list* pProxyGibList = m_pEditorGUI->GetPlacedGibs(); for (std::list::iterator gItr = pProxyGibList->begin(); gItr != pProxyGibList->end(); ++gItr) { - Gib* newGib; + Gib* newGib = new Gib(); // Only set the refernce instance directly from the isntanceman. OWNERSHIP IS NOT TRANSFERRED! newGib->m_GibParticle = dynamic_cast(g_PresetMan.GetEntityPreset((*gItr)->GetClassName(), (*gItr)->GetPresetName(), m_ModuleSpaceID)); if (newGib->m_GibParticle) { From 72065d6fe03fac61ab7c1a96ca98155cbf8ffc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Feb 2025 23:34:57 +0100 Subject: [PATCH 2/2] Mention PVS-Studio in the readme See licensing at https://pvs-studio.com/en/order/open-source-license/ --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 156e74ed5..2907ae5b5 100644 --- a/README.md +++ b/README.md @@ -168,3 +168,7 @@ This repository includes launch configurations to automatically build and debug These launch configurations are accessible via the [Run and Debug](https://code.visualstudio.com/docs/editor/debugging#_run-and-debug-view) view, and provide profiles to build and run the game in Release mode or any of the [3 Debug modes](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/wiki/Meson-build-options). All configurations will run pre-launch tasks to build the game using the supported backend before launching. + +## SAST Tools + +[PVS-Studio](https://pvs-studio.com/en/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.