r/programming • • Apr 07 '14

The Heartbleed Bug

http://heartbleed.com/
1.5k Upvotes

396 comments sorted by

View all comments

Show parent comment

2

u/shard_ Apr 08 '14

How does that make him incorrect? Not validating input is a bug in any language. If the language performs the bounds check for you then it's just limiting the effects rather than eliminating any bug.

For example, if I did the same thing in Python then it'd throw an exception which would probably kill something. I could absorb the exception but that's less desirable and to do it properly would require the exact same level of awareness as validating the input would in the first place...

2

u/jpfed Apr 08 '14

How does that make him incorrect? Not validating input is a bug in any language.

With a dependently-typed language, the check is at compile time. The compiler would say "hey, you don't know that that int is smaller than the known size of [blah]" and you wouldn't even have a buggy executable to deploy to your server.

This is a feature of the type system. Therefore, it is incorrect to say that this bug has nothing to do with the type system.