4 ms·
First, when you write a protocol stack in C, you create memory corruption flaws. It's hard to name any piece of C code that has avoided this problem. [...] Dan
by cperciva 17y ago
First, when you write a protocol stack in C, you create memory corruption flaws. It's hard to name any piece of C code that has avoided this problem. [...] Dan Bernstein managed to let an LP64 overflow slip into qmail.
To be fair to Daniel, the bug you're talking about only exists in a configuration -- unlimited RAM per process -- which he explicitly recommends against. Saying "nobody will ever want to send emails larger than 4 GB" isn't entirely unreasonable.
Leaving that aside, I name the Tarsnap client code as having a protocol stack which avoids memory corruption flaws. Can you prove me wrong?
- tptacek 17y agoIt took years and years to find the LP64 slipup in qmail. No, I'm not going to bother trying to prove you wrong.
- cperciva 17y agoNo, it took a few minutes to find the LP64 slipup in qmail. It took years and years before someone (a) looked for it, and (b) looked in the right place. Sloccount tells me that the entire Tarsnap protocol stack, from event-driven networking up to request/response construction/parsing, is 2732 lines of code. I'm sure that wouldn't take very long to inspect.