View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003059 | FSSCP | Platform-Engine interaction | public | 2014-06-14 05:03 | 2014-06-14 05:10 |
Reporter | Echelon9 | Assigned To | Echelon9 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.7.2 RC3 | ||||
Target Version | 3.7.2 | ||||
Summary | 0003059: Coverity 1204289 String not null terminated in cf_search_root_pack() | ||||
Description | As reported by Coverity, the loading of VP_FILE doesn't ensure the filename element of the structure is null terminated. 689 ... 690 for (i=0; i<VP_header.num_files; i++ ) { 691 VP_FILE find; 692 CID 1204289 (0000001 of 1): String not null terminated (STRING_NULL)6. string_null_argument: Function fread does not terminate string find. 693 fread( &find, sizeof(VP_FILE), 1, fp ); 694 695 find.offset = INTEL_INT( find.offset ); //-V570 696 find.size = INTEL_INT( find.size ); //-V570 697 find.write_time = INTEL_INT( find.write_time ); //-V570 ... | ||||
Tags | No tags attached. | ||||
|
Testing of the simple fix, inserting the line below confirms that no VP files are missing from two runs of the Debug version (pre- and post- change). $ diff fs2_open.log.PRE fs2_open.log.POST 5c5 < Opened log '/Users/xxxx/Library/FS2_Open/data/fs2_open.log', Sat Jun 14 15:03:55 2014 ... --- > Opened log '/Users/xxxx/Library/FS2_Open/data/fs2_open.log', Sat Jun 14 15:15:12 2014 ... 304c304 < cfile_init() took 3790 --- > cfile_init() took 3648 345c345 < ... Log closed, Sat Jun 14 15:04:51 2014 --- > ... Log closed, Sat Jun 14 15:15:58 2014 Added line: find.filename[sizeof(find.filename)-1] = '\0'; |
|
Fix committed to trunk@10808. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-06-14 05:03 | Echelon9 | New Issue | |
2014-06-14 05:03 | Echelon9 | Status | new => assigned |
2014-06-14 05:03 | Echelon9 | Assigned To | => Echelon9 |
2014-06-14 05:04 | Echelon9 | Note Added: 0015859 | |
2014-06-14 05:10 | Echelon9 | Changeset attached | => fs2open trunk r10808 |
2014-06-14 05:10 | Echelon9 | Note Added: 0015860 | |
2014-06-14 05:10 | Echelon9 | Status | assigned => resolved |
2014-06-14 05:10 | Echelon9 | Resolution | open => fixed |