.Net takes some mesures to prevent the buffer overrun, I want to know something about it

  • Thread starter Thread starter Nico
  • Start date Start date
Nico,

I'm not sure what you're looking for. If you debug your program in Visual
Studio 2005 and you overrun a buffer, the debugger pops up a message box
telling you that you have corrupted the heap (if the buffer was allocated on
the heap) when you attempt to destroy the buffer. That is a part of the
development environment.

Anytime you work with buffers you need to make sure that you handle the edge
cases so that you avoid overruns. Especially when using buffers to process
data that can be variable in size. You need to create unit tests that make
it easy for you to test for those conditions. Watch in a memory window to
see exactly what is happening so that you can say with confidence that your
buffer is working as expected.

Good luck,

Kim Greenlee
 
Back
Top