3 ms·
Actually this is a common sort of bug I've seen programmers implement, e.g. using strcpy where memcpy should be used or vice versa. Most common on interface bo
by nullc 6y ago
Actually this is a common sort of bug I've seen programmers implement, e.g. using strcpy where memcpy should be used or vice versa. Most common on interface boundaries with other languages, particular "everything is a string" languages.
So it's not that shocking to see a similar sort of bug made inside the compiler.
- marcan_42 6y agoThat's how the Wii got pwned. They were comparing binary SHA-1 hashes in RSA signatures with strncmp. They also weren't checking padding, so you didn't have to use a real signature with a 00 byte in a convenient place (though I did find one), but rather could just use an all-00 signature, because performing the RSA computation on zero yields zero.
- admax88q 6y agoI wonder how many bugs C strings have been responsible for, all because storing a null byte at the end seems more efficient than storing a length up front.
- userbinator 6y agoGood example of how a little insecurity is sometimes a good thing.