> As I mentioned at the top of this section, this VC++ 2010 ‘buffer overflow’ is apparently not a bug and would never cause crashes during normal usage.
That's the problem when you try to track down bugs in other people's programs. Just give the best info you have, trying to debug a binary black box should be a last resort rather than an attempt to help.
From what I can tell, the program will cause memory access violations during normal usage. Presumably it installs a handler to "fix" the violation and resume the program. You can use this technique to make a buffer that automatically expands without having to put bounds checks in the code. However, getting it right is extremely tricky. You rarely see these kind of tricks outside of language runtimes.
For an example of this kind of trick, imagine writing a heap allocator that simply decremented a pointer and returned it. Heap allocations would be ridiculously fast, requiring one or two instructions per allocation. It does no bounds checking. Eventually it will return a pointer to a bad page which will trigger a signal when the program writes to it, and the signal handler fixes it by doing a garbage collection cycle.
That's the problem when you try to track down bugs in other people's programs. Just give the best info you have, trying to debug a binary black box should be a last resort rather than an attempt to help.
From what I can tell, the program will cause memory access violations during normal usage. Presumably it installs a handler to "fix" the violation and resume the program. You can use this technique to make a buffer that automatically expands without having to put bounds checks in the code. However, getting it right is extremely tricky. You rarely see these kind of tricks outside of language runtimes.
For an example of this kind of trick, imagine writing a heap allocator that simply decremented a pointer and returned it. Heap allocations would be ridiculously fast, requiring one or two instructions per allocation. It does no bounds checking. Eventually it will return a pointer to a bad page which will trigger a signal when the program writes to it, and the signal handler fixes it by doing a garbage collection cycle.