DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.88k stars 251 forks source link

[Init] Fixed Default_pilot initialization #598

Closed pzychotic closed 2 months ago

pzychotic commented 2 months ago

When we have no config file yet, e.g. on first start of the game, or the entry for "Default_pilot" is missing in the config, the variable Default_pilot will be filled with random memory. This might later crash when we try to interpret this string as std::filesystem::path in PilotSelect() in pilot.cpp.

Pull Request Type

Description

When we have no config file yet, e.g. on first start of the game, or the entry for "Default_pilot" is missing in the config, the variable Default_pilot will be filled with random memory. This might later crash when we try to interpret this string as std::filesystem::path in PilotSelect() in pilot.cpp.

Related Issues

Fixes #594

Screenshots (if applicable)

Checklist

Additional Comments

Lgt2x commented 2 months ago

still crashing on pilot::flush when filename is null (tested on linux this time)