solemnwarning / rehex

Reverse Engineers' Hex Editor
https://rehex.solemnwarning.net/
GNU General Public License v2.0
2.31k stars 116 forks source link

Fix the crash described in #113 #116

Closed learn-more closed 3 years ago

learn-more commented 3 years ago

This crashes because REHex::Document::erase_data tries to normalize the cursor pos from -1 (the selection is starting at 0, so the -1 comes from (selection_off - 1). However to normalize it, the cpos_off is used from before the deletion is done, which is 1 at that point.

solemnwarning commented 3 years ago

Thanks for looking into this, I fixed it slightly differently though.