mirror of
https://github.com/curl/curl.git
synced 2026-08-26 11:33:34 +03:00
sftp: fix segfault regression introduced by #4747
This fix adds a defensive check for the case where the char *name in struct libssh2_knownhost is NULL Fixes #5041 Closes #5062
This commit is contained in:
parent
464d944b51
commit
e96fe70cab
3 changed files with 72 additions and 17 deletions
46
tests/data/test1459
Normal file
46
tests/data/test1459
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
SFTP
|
||||
known_hosts
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
sftp
|
||||
</server>
|
||||
<precheck>
|
||||
mkdir -p %PWD/log/test1459.dir/.ssh
|
||||
</precheck>
|
||||
<features>
|
||||
sftp
|
||||
</features>
|
||||
<name>
|
||||
SFTP with corrupted known_hosts
|
||||
</name>
|
||||
<command>
|
||||
-u : sftp://%HOSTIP:%SSHPORT/ -l
|
||||
</command>
|
||||
<file name="log/test1459.dir/.ssh/known_hosts">
|
||||
|1|qy29Y1x/+/F39AzdG5515YSSw+c=|iB2WX5jrU3ZTWc+ZfGau7HHEvBc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAynDN8cDJ3xNzRjTNNGciSHSxpubxhZ6YnkLdp1TkrGW8n\
|
||||
R93Ey5VtBeBblYTRlFXBWJgKFcTKBRJ/O4qBZwbUgt10AHj31i6h8NehfT19tR8wG/YCmj3KtYLHmwdzmW1edEL9G2NdX2KiKYv7/zuly3QvmP0QA0NhWkAz0KdWNM=
|
||||
</file>
|
||||
<setenv>
|
||||
CURL_HOME=%PWD/log/test1459.dir
|
||||
</setenv>
|
||||
</client>
|
||||
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
60
|
||||
</errorcode>
|
||||
<valgrind>
|
||||
disable
|
||||
</valgrind>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue