-
- Downloads
Fix tight loop on reading truncated key files.
In commit 9cc586e6 I changed the low-level key-file reading routines like read_header and read_body so that they read from a BinarySource via get_byte(), rather than from a FILE * via fgetc. But I forgot that the two functions don't signal end-of-file the same way, so testing the return value of get_byte() against EOF is pointless and will never match, and conversely, real EOF won't be spotted unless you also examine the error indicator in the BinarySource. As a result, a key file that ends without a trailing newline will cause a tight loop in one of those low-level read routines.
Loading
Please register or sign in to comment