From d40f33c400ab991a17e7b7499dd5f0fa6e8d2bef Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 31 Oct 2019 15:59:40 +0100 Subject: [PATCH] sftp: Cast sftp version to int This is a public struct and the version should be unsigned there. Fixes T188 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- src/sftp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sftp.c b/src/sftp.c index e5dc453e..13226f9a 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -263,7 +263,7 @@ int sftp_server_init(sftp_session sftp){ ssh_buffer_get_u32(packet->payload, &version); version = ntohl(version); SSH_LOG(SSH_LOG_PACKET, "Client version: %d", version); - sftp->client_version = version; + sftp->client_version = (int)version; reply = ssh_buffer_new(); if (reply == NULL) { @@ -294,7 +294,7 @@ int sftp_server_init(sftp_session sftp){ if (version > LIBSFTP_VERSION) { sftp->version = LIBSFTP_VERSION; } else { - sftp->version=version; + sftp->version = (int)version; } return 0; @@ -725,7 +725,7 @@ int sftp_init(sftp_session sftp) { rc = ssh_buffer_unpack(packet->payload, "s", &ext_name); } - sftp->version = sftp->server_version = version; + sftp->version = sftp->server_version = (int)version; return 0;