6 ms·
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) goto fail; goto fail; /* MISTAKE! THIS LINE SHOULD NOT BE HERE */ if ((err = SSLHas
by IncRnd 9y ago
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail; /* MISTAKE! THIS LINE SHOULD NOT BE HERE */
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
goto fail;
History repeats itself in ever stranger ways. While the effects are different, the original mistake can be quite similar.
- saagarjha 9y agoThis is the SSL bug from iOS 9 for those wondering.
- caseymarquis 9y agoNeat that the textbook justification for Python whitespace syntax over curly brace syntax has caused serious real world bugs.
- emsy 9y agoYou don't even need static analysis (which they should use too) but just a strict coding style check that enforces curly braces. Should've happened after the first incident!
- tempodox 9y agoI find it jaw-dropping how fashionable cowboy coding still is, especially in C family languages.
- eru 9y agoC-family languages are cowboy languages. The whole point of eg C (and C++)'s undefined behaviour is to allow the compiler to make cowboy assumptions like "this array access will never be out of bounds" or "this signed int will never overflow" without having to prove or even justify them. All in the name of 'efficiency'.
- eru 9y agoA coding style check _is_ static analysis. (But that's beating a straw man, of course: with that expanded definition your comment just because "you don't even need anything more than the most primitive forms of static analysis".)
- astrange 9y agoThe Python and Haskell programmers would be upset if you added that pre-commit hook.
- devdoomari 9y agoum... use dependent types? sorry but I'm from different language background :(
- IncRnd 9y agoProvable code would solve the root cause, yes. :) However, even with provable code, the proof actually has to be both correct and performed. There are too many competing factors that won't allow idris, for example, to actually work. The result is that, as an industry, the Internet and the world's business are held together by twine, twist ties, and spaghetti code. Even this very webpage is just enough to work for most people a lot of the time.
- devdoomari 9y agoso... I guess strong-AI-based coding is the only 100% sure way to go (but... I'd be jobless if that were to happen :(
- eru 9y agoStrong AI wouldn't be enough, if by strong AI you mean "enough to pass the Turing test". Humans pass the Turing test all the time, but still produce buggy software.
- IncRnd 9y agoThere are some insanely good architects and programmers. Even so, people write mistaken code, design with faulty assumptions, misinterpret business logic, use libraries and crypto incorrectly, etc. On top of all that, there is a small segment of coders who insert malicious code. They used to write for mayhem but now more for profit. The terms are somewhat contentious, but AIs are more prone to use heuristics than traditional algorithms, which would add another layer of complexity. So, we can't be certain that such an AI itself wouldn't create bugs. If anything, it would be easier to show that bugs would get created. This is simply the state of software. We all deal with it in the ways we can, trying our best to minimize issues and add value.
- 9y ago