1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-02 10:53:16 +03:00

sftp_open: clean up, better check of input data

The clang-analyzer report made it look into this function and
I've went through it to remove a potential use of an
uninitialized variable and I also added some validation of input
data received from the server.

In general, lots of more code in this file need to validate the
input before assuming it is correct: there are servers out there
that have bugs or just have another idea of how to do the SFTP
protocol.
This commit is contained in:
Daniel Stenberg
2010-04-27 23:59:55 +02:00
parent c28fa65424
commit 77efca961d
2 changed files with 89 additions and 72 deletions

View File

@@ -554,7 +554,7 @@ struct _LIBSSH2_SFTP_HANDLE
unsigned char request_packet[SFTP_HANDLE_MAXLEN + 25];
char handle[SFTP_HANDLE_MAXLEN];
int handle_len;
size_t handle_len;
char handle_type;