]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix a segfault in parsing OpenSSH private key files.
authorSimon Tatham <anakin@pobox.com>
Thu, 25 Feb 2016 20:22:23 +0000 (20:22 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 29 Feb 2016 19:59:32 +0000 (19:59 +0000)
commitc195ff2b4f0e7cae40232ae71fe3100027a29061
tree53231ef978979b6fde05bfa653adbba352d2ed1d
parentac9862ec91dba84f9906b1fd58e922321c918918
Fix a segfault in parsing OpenSSH private key files.

The initial test for a line ending with "PRIVATE KEY-----" failed to
take into account the possibility that the line might be shorter than
that. Fixed by introducing a new library function strendswith(), and
strstartswith() for good measure, and using that.

Thanks to Hanno Böck for spotting this, with the aid of AFL.

(cherry picked from commit fa7b23ce9025daba08e86bb934fc430099792b9a)

Conflicts:
misc.c
misc.h

(cherry-picker's note: the conflicts were only due to other functions
introduced on trunk just next to the ones introduced by this commit)
import.c
misc.c
misc.h