Review Request 120900: kio_sftp: Use the right type for timeout_sec and timeout_usec.

Raphael Kubo da Costa rakuco at
Wed Oct 29 22:36:52 GMT 2014

This is an automatically generated e-mail. To reply, visit:

Review request for KDE Runtime and Andreas Schneider.

Bugs: 331674

Repository: kde-runtime


libssh expects the values passed to the SSH_OPTIONS_TIMEOUT and
SSH_OPTIONS_TIMEOUT_USEC to be longs, not plain ints.

On 64-bit platforms with sizeof(long) > sizeof(int), this mismatch can
be problematic and potentially result in invalid memory access that
causes the calls to ssh_options_set() to fail.


  kioslave/sftp/kio_sftp.cpp 21cffac0e5892944ca6c5b74537ebc4b7fb4738e 



This is a bit hard to test, but with some tinkering in `sftpProtocol::sftpOpenConnection()` I can get `ssh_options_set()` to read parts of the argument passed to `sftpOpenConnection()` in addition to the actual value passed to `ssh_options_set()` and make the ioslave always say that it failed to set the timeout value.

With this change, everything works as expected.


Raphael Kubo da Costa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list