View Issue Details

IDProjectCategoryView StatusLast Update
0003046FSSCPFREDpublic2014-05-24 17:18
Reporterniffiwan Assigned ToGoober5000  
PrioritylowSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.7.2 RC1 
Target Version3.7.2 
Summary0003046: Coverity ID 1204292 Uninitialized scalar variable in mission/missionparse.cpp
DescriptionThe issue is reported in function void restore_default_weapons(char *ships_tbl) which seems to be part of the FS1 to FS2 mission conversion code. (In other words, this is probably an issue unlikely to be encountered at the moment, so low priority).

Anyway, this var is not initialised before it's used in a strstr() comparison, which seems like it could have unintended results :)

    char ship_class[NAME_LENGTH];
...
            ch = strstr(ships_tbl, ship_class);

That said, "ship_class" doesn't seem to be set anywhere in the function which makes me think the function won't do what it's intended to do.

My question is; the reported error is easy to fix (i.e. init to '\0' or similar) but there's the bigger issue of where ship_class should be assigned (in the loop presumably). Should the assignment removed in r2768 be readded?
TagsNo tags attached.

Activities

Goober5000

2014-05-24 17:16

administrator   ~0015759

Argh...

There was a strcpy that was accidentally removed in 2768. The result isn't a crash or game breaker, it just means that the remainder of the function is skipped. As a result, the "import weapon loadouts" option does nothing.

Good job of Coverity to catch it, but I'll have to see what this means for FSPort. :p

Goober5000

2014-05-24 17:18

administrator   ~0015760

Fix committed to trunk@10718.

Related Changesets

fs2open: trunk r10718

2014-05-24 12:33

Goober5000


Ported: N/A

Details Diff
restore a strcpy that was accidentally removed in r2768 (fixes Mantis 0003046) Affected Issues
0003046
mod - /trunk/fs2_open/code/mission/missionparse.cpp Diff File

Issue History

Date Modified Username Field Change
2014-05-23 23:34 niffiwan New Issue
2014-05-23 23:34 niffiwan Status new => assigned
2014-05-23 23:34 niffiwan Assigned To => Goober5000
2014-05-24 17:16 Goober5000 Note Added: 0015759
2014-05-24 17:18 Goober5000 Changeset attached => fs2open trunk r10718
2014-05-24 17:18 Goober5000 Note Added: 0015760
2014-05-24 17:18 Goober5000 Status assigned => resolved
2014-05-24 17:18 Goober5000 Resolution open => fixed