~vcs-imports/putty/trunk

Viewing all changes in revision 3737.

  • Committer: simon
  • Date: 2014-07-28 17:47:36 UTC
  • Revision ID: svn-v4:cda61777-01e9-0310-a592-d414129be87e:putty:10211
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_.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: