samp-plugin-crashdetect icon indicating copy to clipboard operation
samp-plugin-crashdetect copied to clipboard

Fix lines table overflow detection segfault

Open Cheaterman opened this issue 4 years ago • 3 comments

Cheaterman avatar Sep 04 '21 13:09 Cheaterman

Could you write a few lines to explain what this patch does? And where the values 33 and 0x10000 come from?

Zeex avatar Mar 12 '22 21:03 Zeex

I think the title explains it pretty well. You're currently reading unmapped memory to find where the lines table ends, and (wrongly) expecting zeroes when you do (instead of garbage or an outright crash).

The values have to do with AMX structure. I honestly do not remember. This is tested, working, and most importantly correct (at least more than the original code...).

Cheaterman avatar Mar 14 '22 12:03 Cheaterman

OK, that's great, thanks

Zeex avatar Mar 20 '22 07:03 Zeex

Ended up implementing it a little differently in master.

Zeex avatar Feb 18 '23 20:02 Zeex