TheAshenWolf / WakaTimeForUE

As all the other versions of Wakatime plugins for Unreal Engine lead to blank repos, I decided to make a plugin that actually has some code in it. I am no longer working on this plugin, but the community is, so feel free to contribute!
MIT License
44 stars 11 forks source link

GUserProfile: Use after free #34

Closed Subtixx closed 7 months ago

Subtixx commented 7 months ago

https://github.com/TheAshenWolf/WakaTimeForUE/blob/61a8c1fbb4e25681c8610e630d99443e97aee1da/Source/WakaTimeForUE/Private/WakaTimeForUE.cpp#L176

Who approved this? A global variable that gets freed without the module being shutdown?

Btw. its already happening on shutdown...

https://github.com/TheAshenWolf/WakaTimeForUE/blob/61a8c1fbb4e25681c8610e630d99443e97aee1da/Source/WakaTimeForUE/Private/WakaTimeForUE.cpp#L158

EDIT: Thanks to gitblame: Was introduced here 94148dee3efde6fb4af18d651967e8f5f5f6f948

Results in:

Log          LogWakaTime               Running command:  /c start /b where /r Z\.wakatime\wakatime-cli-windows-amd64.exe
Log          LogWakaTime               Did not find wakatime
Log          LogWakaTime               Running command:  /c start /b mkdir Z\.wakatime
Log          LogWakaTime               CLI not found, attempting download.
TheAshenWolf commented 7 months ago

I am afraid this is on me;

My Cpp days are long gone and I didn't read the changes thoroughly.

Thank you for the catch. It makes sense looking at it now.