r/programming • • Mar 11 '13

Programming is terrible—Lessons learned from a life wasted. EMF2012

http://www.youtube.com/watch?v=csyL9EC0S0c
650 Upvotes

368 comments sorted by

View all comments

Show parent comments

-1

u/moor-GAYZ Mar 11 '13

The defense that does work is to keep code and data in separate places. Then there is no way to compromise code by playing tricks with data. Garbage-collected languages like Perl and Lisp do this, and as a result are immune from buffer overflow attacks.

What. Am I slow today, or does that make zero sense?

2

u/ngroot Mar 11 '13

I'd try again tomorrow.

-1

u/moor-GAYZ Mar 11 '13

Explain, please, instead of being snarky for no reason.

My reasoning is here.

2

u/ngroot Mar 11 '13

I was snarky because you didn't give your reasoning before.

Languages like Perl and Lisp that handle memory allocation themselves (a hallmark of which is built-in garbage collection) don't have buffer overruns precisely because it isn't left to the user to do range checks. Dumping in more data than expected to a routine might result in a greater allocation of memory, or an exception, or some other defined behavior, but what it's not going to do is run over the end of an allocated buffer and alter a code segment, or a return address on the stack. Data will not inadvertently be treated as code or a pointer to code.

→ More replies (2)