View Issue Details

IDProjectCategoryView StatusLast Update
0002647FSSCPphysicspublic2012-07-01 04:35
ReporterEchelon9 Assigned ToThe_E  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.14 RC5 
Target Version3.6.14 
Summary0002647: PVS-Studio warning: Pointer to local variables stored outside scope in ArmorType::GetDamage()
DescriptionSeries of pointer related issues that may be related to the armour / damage problems that have been reported in WiH.

For more background, see http://www.viva64.com/en/d/0095/
Additional InformationV506 Pointer to local variable 'base_damage' is stored outside the scope of this variable. Such a pointer will become invalid. ship.cpp:16650
V506 Pointer to local variable 'constant_val' is stored outside the scope of this variable. Such a pointer will become invalid. ship.cpp:16660
V506 Pointer to local variable 'constant_val' is stored outside the scope of this variable. Such a pointer will become invalid. ship.cpp:16664
V506 Pointer to local variable 'constant_val' is stored outside the scope of this variable. Such a pointer will become invalid. ship.cpp:16668
TagsNo tags attached.

Activities

The_E

2012-05-10 15:02

administrator   ~0013539

Fix committed to trunk@8769.

Echelon9

2012-05-13 05:16

developer   ~0013556

Not resolved, still present as of r8780.

The_E

2012-05-13 19:36

administrator   ~0013557

Fix committed to trunk@8781.

Zacam

2012-06-28 18:13

administrator   ~0013734

This was flagged under RC5, but the code that PVS Studio checked was trunk specific, so the fixes by the related commits (8769/8770/8781) can't be applied to the RC Branch due to Nukes Armor Types changes not being present in the RC Branch.

We need a better evaluation of the RC Branch code for this issue with an RC Branch specific fix (preferably by patch first to test) to evaluate how to actually fix this problem in RC Branch for Final.

Goober5000

2012-06-30 23:42

administrator   ~0013739

Maybe this doesn't actually affect the RC branch. I just looked at the 3.6.14 code and those variables aren't even present in ship.cpp.

Goober5000

2012-07-01 04:35

administrator   ~0013742

Re-resolving because no change is needed in the 3.6.14 branch.

Related Changesets

fs2open: trunk r8769

2012-05-10 11:04

The_E


Ported: N/A

Details Diff
Fix for Mantis 2647: Pointers becoming invalid when going out of scope during armor calculations (PVS Studio warning)
Affected Issues
0002647
mod - /trunk/fs2_open/code/ship/ship.cpp Diff File

fs2open: trunk r8781

2012-05-13 15:38

The_E


Ported: N/A

Details Diff
Fix for Mantis 2647, take two: Remove the pointers in question
Affected Issues
0002647
mod - /trunk/fs2_open/code/ship/ship.cpp Diff File

Issue History

Date Modified Username Field Change
2012-05-06 14:56 Echelon9 New Issue
2012-05-06 14:58 Echelon9 Summary PVS-Studio warning: Pointer to local variable stored outside scope in ArmorType::GetDamage() => PVS-Studio warning: Pointer to local variables stored outside scope in ArmorType::GetDamage()
2012-05-10 15:02 The_E Changeset attached => fs2open trunk r8769
2012-05-10 15:02 The_E Note Added: 0013539
2012-05-10 15:02 The_E Status new => resolved
2012-05-10 15:02 The_E Resolution open => fixed
2012-05-13 05:16 Echelon9 Assigned To => The_E
2012-05-13 05:16 Echelon9 Note Added: 0013556
2012-05-13 05:16 Echelon9 Status resolved => feedback
2012-05-13 05:16 Echelon9 Resolution fixed => reopened
2012-05-13 19:36 The_E Changeset attached => fs2open trunk r8781
2012-05-13 19:36 The_E Note Added: 0013557
2012-05-13 19:36 The_E Status feedback => resolved
2012-06-28 18:13 Zacam Note Added: 0013734
2012-06-28 18:13 Zacam Status resolved => feedback
2012-06-30 23:42 Goober5000 Note Added: 0013739
2012-07-01 04:35 Goober5000 Note Added: 0013742
2012-07-01 04:35 Goober5000 Status feedback => resolved
2012-07-01 04:35 Goober5000 Resolution reopened => fixed