]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix another crash at KEXINIT time, ahem.
authorSimon Tatham <anakin@pobox.com>
Mon, 28 Jul 2014 17:47:36 +0000 (17:47 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 28 Jul 2014 17:47:36 +0000 (17:47 +0000)
commit4b2a2060bb829017b8098c0f3a2064d07145190e
tree92392cff773d740dbf8905d54a441b12c64d2905
parent440962281a6e92d681104d3383717a07cead7c0b
Fix another crash at KEXINIT time, ahem.

This is the same code I previously fixed for failing to check NULL
pointers coming back from ssh_pkt_getstring if the server's KEXINIT
ended early, leading to an embarrassing segfault in place of a fatal
error message. But I've now also had it pointed out to me that the
fatal error message passes the string as %s, which is inappropriate
because (being read straight out of the middle of an SSH packet) it
isn't necessarily zero-terminated!

This is still just an embarrassing segfault in place of a fatal error
message, and not exploitable as far as I can see, because the string
is passed to a dupprintf, which will either read off the end of
allocated address space and segfault non-exploitably, or else it will
find a NUL after all and carefully allocate enough space to format an
error message containing all of the previous junk. But still, how
embarrassing to have messed up the same code _twice_.

[originally from svn r10211]
ssh.c