expired6978 / SKSE64Plugins

Collection of all SKSE64 compatible plugins
128 stars 42 forks source link

Overflow in qsort comparison function #42

Open SlavicPotato opened 4 years ago

SlavicPotato commented 4 years ago

The issue is in skse NiObjectNET::AddExtraData, the comparison function used while sorting m_extraData can overflow since it casts the pointer difference directly to an int. This happens frequently when using Engine Fixes' memory manager, causing random issues with morphs/transforms since binary searches on the array fail at random.

expired6978 commented 4 years ago

Interesting. The delta itself shouldn't be that large normally, I've changed the implementation to not use qsort.

SlavicPotato commented 4 years ago

I've never observed deltas that large using skyrim's memory manager, only with os/tbb allocators. (pl > pr) - (pl < pr) idiom should work too.

BullOnMars commented 1 year ago

Narrowed down, this overflow bug somehow is back in latest version on Nexus for AE version. Many people have failed morphs using OBody and AutoBody when using along side with EngineFixes's Memory Manager...