Subject: Re: [libssh2] #276: do not fail when keys of unknown type are read from known_hosts file

Re: [libssh2] #276: do not fail when keys of unknown type are read from known_hosts file

From: libssh2 Trac <trac_at_libssh2.stuge.se>
Date: Sun, 06 Oct 2013 00:07:16 -0000

#276: do not fail when keys of unknown type are read from known_hosts file
---------------------+-------------------
  Reporter: salva | Owner:
      Type: defect | Status: new
  Priority: normal | Milestone: 1.4.3
 Component: misc | Version: 1.4.2
Resolution: | Keywords:
Blocked By: | Blocks:
---------------------+-------------------

Comment (by salva):

 I have submitted two new patches, one for every one of your observations.

 The first one keeps the length of the key-type and uses it. Actually I
 have found that the host and comment slots are affected by the same issue,
 so I have also modified the code related to those, keeping their lengths
 in the known_host struct, and using memcpy to move then into the buffer
 instead of snprintf(..., "%s", ...) which stops at nulls.

 Regarding the usage of "goto", well, I don't see it as inappropriate in
 that case, but it is your code and so your choice. The second patch
 replaces the jumps by calls to _libssh2_error.

-- 
Ticket URL: <https://trac.libssh2.org/ticket/276#comment:2>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2013-10-06