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

[Crash] Resolve crash due to uninitialized pointer. #3271

Merged
merged 1 commit into from Apr 8, 2023

Conversation

Aeadoin
Copy link
Contributor

@Aeadoin Aeadoin commented Apr 8, 2023

This PR fixes an issue where const ItemData* m_item could be left in an uninitialized state, which would cause a crash when we attempt to dereference it, as seen in the below crash:

http://spire.akkadius.com/dev/release/22.9.1-dev?id=3061

This would also fix the following crash as well:

https://discord.com/channels/212663220849213441/1093971541382934630/1093971541382934630

I use Non Static Data Members Initialization (also called In-Class Member Initialization) to initialize the values for both objects, this ensures any value that doesn't get assigned have a valid assignment (0, "" or nullptr) depending on type.

@Aeadoin Aeadoin merged commit 647bcce into EQEmu:master Apr 8, 2023
1 check passed
@Aeadoin Aeadoin deleted the itemdatacrash branch April 8, 2023 21:21
@Aeadoin Aeadoin mentioned this pull request Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants