Andreas Schneider
|
cc83b463ce
|
sftp: Fix a possible null pointer dereference
CID 1395721
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-18 10:19:59 +02:00 |
|
Andreas Schneider
|
0762057eb9
|
sftp: Move the packet payload to the message
This reduces memory allocations and copying.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
57153f6481
|
sftp: Use SSH_BUFFER_FREE in sftp_message_free()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
4c32befd93
|
sftp: Reformat sftp_message_free()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
be8302e2f3
|
sftp: Allocate a new buffer in sftp_packet_read() if needed
We will move the buffer to the message instead of duplicating the
memory.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
97d2e1f4cb
|
sftp: Reformat sftp_read_and_dispatch()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
12fc0ea1bf
|
sftp: Validate the packet handle before we allocate memory
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
573eab0d51
|
sftp: Reformat sftp_get_message()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
0e317e612f
|
sftp: Use bool for is_eof in sftp_packet_read()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
01135703a3
|
sftp: Use 's' only in the scope it is needed
This revaled a bug when reading the packet type.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
c070414309
|
sftp: Use 16K for the transfer buffer size
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
d2cc4eccc7
|
sftp: Get the packet type directly from the buffer
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
38781f69b0
|
sftp: Limit packet size to 256 MB
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
dc4faf9952
|
sftp: Directly read and validate the packet size from the bufffer
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
cbbc6ddcb6
|
sftp: Use read_packet from sftp handle
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
a7456bf4d5
|
sftp: Simplify the code for reading data
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
afc14fe003
|
sftp: Reformat sftp_packet_read()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
79a3fcac72
|
sftp: Keep a ssh_packet for reading in the sftp handle
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
945afaa6b4
|
sftp: Remove ZERO_STRUCTP from sftp_free()
The structure doesn't hold any sensitive data and this would be
optimized away anyway.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
d840a05be3
|
sftp: Reformat sftp_free()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
662c30eb72
|
sftp: Reformat sftp_new()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-17 10:48:49 +02:00 |
|
Andreas Schneider
|
4774d2b9f7
|
sftp: Fix segfault in sftp_canonicalize_path()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-04 17:30:18 +02:00 |
|
Andreas Schneider
|
e601dbd8e3
|
sftp: Use ssh_buffer_pack() in sftp_fstat()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
f3ffd8aa41
|
sftp: Reformat sftp_lstat()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
4d98b1cd7e
|
sftp: Use ssh_buffer_pack() in sftp_xstat()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
b00a0578f9
|
sftp: Reformat sftp_xstat()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
336c097ae7
|
sftp: Use ssh_buffer_unpack() in sftp_canonicalize_path()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
1dd8466f66
|
sftp: Use ssh_buffer_pack() in sftp_canonicalize_path()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
8b19ef05f3
|
sftp: Reformat sftp_canonicalize_path()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
7e11e41a9f
|
sftp: Use sftp_buffer_pack() in sftp_fstatvfs()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
5914ea7c75
|
sftp: Reformat sftp_fstatvfs()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
f1e84d5e67
|
sftp: Use ssh_buffer_pack() in sftp_fsync()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
8e3dd09e11
|
sftp: Use ssh_buffer_pack() in sftp_statvfs()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
ae0afec98d
|
sftp: Reformat sftp_statvfs()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
0be43c333e
|
sftp: Use ssh_buffer_unpack() in sftp_readlink()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
83a5d3b258
|
sftp: Use ssh_buffer_pack() in sftp_readlink()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:23 +02:00 |
|
Andreas Schneider
|
bb4bdec184
|
sftp: Reformat sftp_readlink()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:39:16 +02:00 |
|
Andreas Schneider
|
e0449ba21f
|
sftp: Use ssh_buffer_pack() in sftp_setstat()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:37:24 +02:00 |
|
Andreas Schneider
|
8a56b90c3e
|
sftp: Reformat sftp_setstat()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:36:29 +02:00 |
|
Andreas Schneider
|
218c67a51d
|
sftp: Use ssh_buffer_pack() in sftp_mkdir()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:36:29 +02:00 |
|
Andreas Schneider
|
89c525bbf1
|
sftp: Reformat sftp_mkdir()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:36:29 +02:00 |
|
Andreas Schneider
|
2c0baef7d4
|
sftp: Use ssh_buffer_pack in sftp_open()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:34:00 +02:00 |
|
Andreas Schneider
|
bfb6718b50
|
sftp: Reformat sftp_open()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:34:00 +02:00 |
|
Andreas Schneider
|
d99c066a0b
|
sftp: Use ssh_buffer_pack() in sftp_handle_close()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:34:00 +02:00 |
|
Andreas Schneider
|
2844942c1b
|
sftp: Reformat sftp_handle_close()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:34:00 +02:00 |
|
Andreas Schneider
|
3a729829fd
|
sftp: Use ssh_buffer_pack() in sftp_readdir()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:34:00 +02:00 |
|
Andreas Schneider
|
576fdbe1e8
|
sftp: Reformat sftp_readdir()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:32:45 +02:00 |
|
Andreas Schneider
|
87df9cfc5d
|
sftp: Use ssh_buffer_pack() in sftp_opendir()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:32:23 +02:00 |
|
Andreas Schneider
|
ea375d1605
|
sftp: Reformat sftp_opendir()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-09-03 18:32:23 +02:00 |
|
Andreas Schneider
|
509331ec81
|
sftp: Use strndup()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
2018-08-29 19:04:44 +02:00 |
|