asar icon indicating copy to clipboard operation
asar copied to clipboard

Segfault on asar_patch when using as a static library

Open VirusRushTheater opened this issue 3 years ago • 0 comments
trafficstars

I've tracked the error and it's because the variable romdata_r at interface_lib.cpp gets freed twice: First on asar_patch_begin->resetdllstuff->reseteverything and then on asar_patch_end because it triggers the condition where that variable is freed (again). This is where the program I'm using Asar on triggers a segmentation fault.

I suggest the usage of an additional flag to check whether to free romdata_r, or making it NULL and check again.

EDIT: I commented the block where it frees the variable in reseteverything and it worked properly, even though I've silenced the Sanitizer.

VirusRushTheater avatar Oct 15 '22 05:10 VirusRushTheater