View Issue Details

IDProjectCategoryView StatusLast Update
0002578FSSCPFREDpublic2012-01-23 23:04
Reporterchief1983 Assigned Tochief1983  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Platformx86-64OSWindows 7OS VersionProfessional
Product Version3.6.13 
Target Version3.6.14Fixed in Version3.6.14 
Summary0002578: Assert(strlen(shipp->ship_name) < NAME_LENGTH - 1); (with 31 character ship name)
DescriptionI hit this assert adding a ship to a mission. NAME_LENGTH is 32. The ship has a 31 character name. That's within the limits everywhere else in the code, but not here, because it improperly checks. It subtracts one for the null terminator \0, and also uses < instead of <=.
Steps To ReproduceUse debug build.
Have a ship with 31 character name.
Add it to a mission.
Additional InformationI found two other places that compare to NAME_LENGTH in this exact manner, in the ai code. They should be fixed too.
TagsNo tags attached.

Activities

chief1983

2012-01-23 01:22

administrator   ~0013113

Fix committed to trunk@8326.

chief1983

2012-01-23 23:04

administrator   ~0013135

Fix committed to fs2_open_3_6_14@8357.

Related Changesets

fs2open: trunk r8326

2012-01-22 20:22

chief1983


Ported: N/A

Details Diff
Fixes 0002578 - Change the < in these checks against NAME_LENGTH to <=. Affected Issues
0002578
mod - /trunk/fs2_open/code/ship/ship.cpp Diff File
mod - /trunk/fs2_open/code/ai/aigoals.cpp Diff File
mod - /trunk/fs2_open/code/ai/ai.cpp Diff File

fs2open: fs2_open_3_6_14 r8357

2012-01-23 18:04

chief1983


Ported: N/A

Details Diff
Backport: Trunk 8326; Fixes 0002578 - Change the < in these checks against NAME_LENGTH to <=. Affected Issues
0002578
mod - /branches/fs2_open_3_6_14/code/ship/ship.cpp Diff File
mod - /branches/fs2_open_3_6_14/code/ai/aigoals.cpp Diff File
mod - /branches/fs2_open_3_6_14/code/ai/ai.cpp Diff File

Issue History

Date Modified Username Field Change
2012-01-23 01:20 chief1983 New Issue
2012-01-23 01:20 chief1983 Status new => assigned
2012-01-23 01:20 chief1983 Assigned To => chief1983
2012-01-23 01:22 chief1983 Changeset attached => fs2open trunk r8326
2012-01-23 01:22 chief1983 Note Added: 0013113
2012-01-23 01:22 chief1983 Status assigned => resolved
2012-01-23 01:22 chief1983 Resolution open => fixed
2012-01-23 01:25 chief1983 Fixed in Version => 3.6.14
2012-01-23 23:04 chief1983 Changeset attached => fs2open fs2_open_3_6_14 r8357
2012-01-23 23:04 chief1983 Note Added: 0013135