View Issue Details

IDProjectCategoryView StatusLast Update
0002620FSSCPmath-relatedpublic2012-05-01 12:25
ReporterEchelon9 Assigned ToEchelon9  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.14 RC5 
Target Version3.6.14 
Summary0002620: PVS-Studio warning: Consider inspecting the '(strlen(filename) > 6)' expression.
DescriptionA bug introduced with r3814 (December 2006) in the calculation of filename lengths to accommodate Weapon explosion LOD0 animations.

Order of precedence within the brackets causes an incorrect if block evaluation.

---------

 if ( MAX_FILENAME_LEN - (strlen(filename) > 6) ) {

should become

 if ( (MAX_FILENAME_LEN - strlen(filename)) > 6 ) {
TagsNo tags attached.

Activities

Echelon9

2012-03-03 00:22

developer   ~0013373

Fix committed to trunk@8552.

niffiwan

2012-05-01 12:25

developer   ~0013496

Fix committed to fs2_open_3_6_14@8710.

Related Changesets

fs2open: trunk r8552

2012-03-02 19:22

Echelon9


Ported: N/A

Details Diff
Fix Mantis 2620 - PVS-Studio warning: Consider inspecting the '(strlen(filename) > 6)' expression. A 5 year old bug. Affected Issues
0002620
mod - /trunk/fs2_open/code/weapon/weapons.cpp Diff File

fs2open: fs2_open_3_6_14 r8710

2012-05-01 08:27

niffiwan


Ported: N/A

Details Diff
Backport: Trunk r8552; Fix Mantis 2620 - PVS-Studio warning: Consider inspecting the '(strlen(filename) > 6)' expression. A 5 year old bug. Affected Issues
0002620
mod - /branches/fs2_open_3_6_14/code/weapon/weapons.cpp Diff File

Issue History

Date Modified Username Field Change
2012-03-03 00:20 Echelon9 New Issue
2012-03-03 00:20 Echelon9 Status new => assigned
2012-03-03 00:20 Echelon9 Assigned To => Echelon9
2012-03-03 00:22 Echelon9 Changeset attached => fs2open trunk r8552
2012-03-03 00:22 Echelon9 Note Added: 0013373
2012-03-03 00:22 Echelon9 Status assigned => resolved
2012-03-03 00:22 Echelon9 Resolution open => fixed
2012-05-01 12:25 niffiwan Changeset attached => fs2open fs2_open_3_6_14 r8710
2012-05-01 12:25 niffiwan Note Added: 0013496