What is "Access Overrun"?

delphi package - automated exception handling

What is "Access Overrun"?

Postby rodc » Fri Dec 16, 2016 6:13 pm

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?
rodc
 
Posts: 8
Joined: Fri Mar 23, 2007 7:24 pm
Location: Porto Alegre - Brazil

Re: What is "Access Overrun"?

Postby madshi » Wed Dec 21, 2016 12:04 pm

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.
madshi
Site Admin
 
Posts: 9338
Joined: Sun Mar 21, 2004 5:25 pm


Return to madExcept

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests