Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Boogieman
A very clever backdoor indeed. Good plausible deniability too, since this is such a common typo for C programmers, and one that isn’t even caught by syntax checkers, since it is still perfectly valid syntax.

Yes, it's actually a C idiom. E.g., to process the contents of a file:

while (bytes_read = read(buffer)) {
    // Work with buffer
}
// ... Dropped out of read loop because zero bytes were read

Commonly used compilers can be set to warn when the above is used, requiring it to be changed to:

while ((bytes_read = read(buffer)) != 0) {
    // Work with buffer
}
// ... Dropped out of read loop because zero bytes were read

to avoid the warning. Of course, the assignment still takes place whether the target is bytes_read or current->uid.

12 posted on 10/10/2013 1:27:21 PM PDT by cynwoody
[ Post Reply | Private Reply | To 5 | View Replies ]


To: cynwoody

Yeah, that can be a handy way to save typing another line of code, when it’s used intentionally. Unintentionally, it can cause you to pull your hair out trying to debug :)


17 posted on 10/10/2013 2:27:29 PM PDT by Boogieman
[ Post Reply | Private Reply | To 12 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson