Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid use-after-free in vehicle reaper code #39109

Merged
merged 1 commit into from
Mar 29, 2020

Conversation

Qrox
Copy link
Contributor

@Qrox Qrox commented Mar 29, 2020

Summary

SUMMARY: Bugfixes "Fix a crash when harvesting using vehicle reaper"

Purpose of change

Fixes #39069. A use-after-free error was causing crash on the official windows build, when using vehicle reaper to harvest crops.

Describe the solution

Save the seed type to a local variable before the seed item gets destroyed by map::i_clear.

Testing

Cannot test because the crash cannot be reproduced on my own build. After merging it we'll know if it fixes the crash.

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Vehicles Vehicles, parts, mechanics & interactions labels Mar 29, 2020
@ZhilkinSerg ZhilkinSerg merged commit c6c9e6f into CleverRaven:master Mar 29, 2020
@Qrox Qrox deleted the fix-reaper-crash branch March 30, 2020 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault crash when using reaper
2 participants