I've been having crash problems due to heap problems, so I guess a buffer overflow is happening somewhere. How do I detect it?
Asked
Active
Viewed 1,626 times
2
-
"heap problems" are far from synonymous with "buffer oberflow" – Apr 23 '09 at 20:05
-
1They aren't synonyms, certainly, but heap problems are a likely symptom of buffer overruns. – RBerteig Apr 23 '09 at 20:14
4 Answers
3
I use Compuware BoundsChecker as a tool for error detection in VC6. It can pick up buffer overruns.
You can also try PageHeap, a tool for windows.

Snazzer
- 7,704
- 5
- 27
- 25
-
I had some problems trying to use PageHeap, this question defines them: http://stackoverflow.com/questions/781821/debug-visual-c-memory-allocation-problems Could you provide more info on how to use it? – Rodrigo Apr 23 '09 at 20:18
1
You can use the VC debug heap: http://msdn.microsoft.com/en-us/library/974tc9t1.aspx
Most if not all of the stuff in crtdbg.h is also supported in VC6.

Michael Burr
- 333,147
- 50
- 533
- 760
0
I got good results when simply inserting _heapchk() Windows API function on some places and hunt the error (a access to index -1 to an array in my case).

mmmmmmmm
- 15,269
- 2
- 30
- 55