Page 1 of 1
What is "Access Overrun"?
Posted: Fri Dec 16, 2016 6:13 pm
by rodc
The option "instantly crash on buffer ... overrun" on madexcept shouldn't catch this type of error? Or I didn't understood what is this option?
Code: Select all
int test[2];
test[3] = 20; // isn't it an access overrun?
Re: What is "Access Overrun"?
Posted: Wed Dec 21, 2016 12:04 pm
by madshi
It depends. If the array is *allocated* then such a type of error should be detected. However, it also depends on allocation alignment. Some code requires code to be aligned in a certain way. Because of that it's sometimes possible that I can't detect if you just overrun a buffer by a tiny amount (say just 1 byte or maybe 2-3 bytes), but it also depends on the exact size of the buffer.
Your code seems to use a local variable. Such variables are not allocated, they're instead placed on the stack by the compiler, which makes it technically impossible for me to detect an overrun.