simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun May 23 09:25:57 BST 2021


TL;DR:
  d008d235 Fix tight loop on reading truncated key files.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2021-05-23 09:25:57

commit d008d235f3841139daca39efee25cd5423ce31b8
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d008d235f3841139daca39efee25cd5423ce31b8;hp=0d3bb73608f1a5d1d5337e51736d48dad1436af5
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun May 23 08:59:13 2021 +0100

    Fix tight loop on reading truncated key files.
    
    In commit 9cc586e605e3db1 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.

 sshpubk.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)



More information about the tartarus-commits mailing list