3 ms·
Quite disturbing to think about it. There are probably millions of lines of code in the kernel, how confidently can you say that there's no other instance of so
by borplk 13y ago
Quite disturbing to think about it. There are probably millions of lines of code in the kernel, how confidently can you say that there's no other instance of something like this slipping in? I mean it's just one damn '=' character.
- bentcorner 13y agoThe more I think about it, the more programming (and computers in general) frustrate me. In the non-digital world, the general rule is small mistakes lead to small consequences (for example, overcooking food will result in it burning and getting worse over time).
- lcedp 13y agoBut not watching your cooking process can also result to blowing up whole building due to gas explosion. More often it would be just bad meal, of course. But more often small mistake in a program will just result to a compile error or bad behavior.
- Patrick_Devine 13y agoIsn't this also what makes computers so wonderful? Small amounts of code let you do amazing things.
- keithpeter 13y agoA piece of telco software had been written in C language, a standard language of the telco field. Within the C software was a long "do... while" construct. The "do... while" construct contained a "switch" statement. The "switch" statement contained an "if" clause. The "if" clause contained a "break." The "break" was supposed to "break" the "if clause." Instead, the "break" broke the "switch" statement. Ctrl-F the above phrase in http://www.mit.edu/hacker/part1.html http://www.mit.edu/hacker/part1.html Security concerns always seem to involve low level code in device drivers or firmware. Indeed, one character in the wrong place and we have problems
- groby_b 13y agoAlso, that statement is guaranteed to be wrong. You don't "break" if clauses. But hey, it's about hackers and on mit.edu, it must be correct :)
- keithpeter 13y agoYes, I thought that the 'break' keyword wasn't used in if clauses. I took it to mean a problem with line ending resulting in the premature closure of the switch block. Anyone any ideas as to possible syntax?
- epsylon 13y agoIt would make sense if the author had meant do clause instead of if clause. Something like that: do { switch (bleh) { case MEH: if (derp) { break; /* supposed exit the do..while loop early... except it only exits the switch statement */ } [...] break; /* usually there's a break at the end of each case statement, but the programmer might not have seen it if it's far away */ [...] } fun_stuff(); /* not supposed to be called when bleh == MEH and derp is non-null */ } while (quux);
- forgottenpaswrd 13y ago"how confidently can you say that there's no other instance of something like this slipping in? " Well, you have compilers that displays you warnings about it. If you don't catch the error you have static analyzers, if not you have Valgrind and other memory tools(linux have some jewels here), and if not you have your own parsing code for automatic checking of anything suspicious like becoming superuser. So is not that disturbing as this example is something that even gcc with Waring=all catch. LLVM is better in this respect.