30+ years ago, when I took Computer Science 100 in college, one of the important lessons was that you should *never* trust input, and we had to run our homework programs on maliciously designed data (especially useful for finding off-by-one errors.)
The main causes of stack overflow are input routines that don't check how much data you're handing them, and there's simply no excuse for allowing that in professional code. I'm guessing that the buggy programs were written in C - it's a beautiful efficient language, but it *will* let you shoot yourself in the foot - or else in some variant like C++ or C#, which offer you better-protected data structures but still let you use the old-fashioned ones.


Post new comment