From 018602cb34a58634881dab3992f5825f5d2c9fb2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 31 Aug 2010 19:56:00 +0200 Subject: [PATCH] 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 --- src/scp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/scp.c b/src/scp.c index e29dcf74..6eea9bc0 100644 --- a/src/scp.c +++ b/src/scp.c @@ -621,11 +621,9 @@ scp_recv(LIBSSH2_SESSION * session, const char *path, struct stat * sb) scpRecv_response[session->scpRecv_response_len - 1] != '\n') && - ((session-> - scpRecv_response[session->scpRecv_response_len - 1] < 32) - || (session-> - scpRecv_response[session->scpRecv_response_len - 1] > - 126))) { + (session-> + scpRecv_response[session->scpRecv_response_len - 1] + < 32)) { _libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL, "Invalid data in SCP response"); goto scp_recv_error;