SCP: allow file names with bytes > 126
When parsing the SCP protocol and verifying that the data looks like a valid file name, byte values over 126 must not be consider illegal since UTF-8 file names will use such codes. Reported by: Uli Zappe Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2010-08/0112.shtml
This commit is contained in:
parent
eec7f2fb63
commit
018602cb34
@ -621,11 +621,9 @@ scp_recv(LIBSSH2_SESSION * session, const char *path, struct stat * sb)
|
|||||||
scpRecv_response[session->scpRecv_response_len - 1] !=
|
scpRecv_response[session->scpRecv_response_len - 1] !=
|
||||||
'\n')
|
'\n')
|
||||||
&&
|
&&
|
||||||
((session->
|
(session->
|
||||||
scpRecv_response[session->scpRecv_response_len - 1] < 32)
|
scpRecv_response[session->scpRecv_response_len - 1]
|
||||||
|| (session->
|
< 32)) {
|
||||||
scpRecv_response[session->scpRecv_response_len - 1] >
|
|
||||||
126))) {
|
|
||||||
_libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL,
|
_libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL,
|
||||||
"Invalid data in SCP response");
|
"Invalid data in SCP response");
|
||||||
goto scp_recv_error;
|
goto scp_recv_error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user