Comments (4)
I can confirm that some weird things happen if the buffer maxlen is much larger than 4k (7k works for me also, but 8k is too large). I end up in an infinite loop where libssh2_sftp_read() keeps returning 0 (in blocking mode).
I don't get any access violation however (also Win7 x64).
from libssh2.
I have investigated this issue a little further (using example-sftp) on both of my libssh2 builds (Ubuntu 14.10 and Windows 7) at work.
Corrupted downloads happen (in both builds) if buffer_maxlen * 4 > MAX_SFTP_READ_SIZE. So with the current MAX_SFTP_READ_SIZE=30000, problems occur if buffer_maxlen>7500.
Edit: It is actually the "max_read_ahead" value in sftp.c that causes the issue. It is set to 4*buffer_size but if it exceeds MAX_SFTP_READ_SIZE things break.
As a workaround we could use max_read_ahead = MIN(MAX_SFTP_READ_SIZE, 4*buffer_size) until someone figures out the right solution here...
from libssh2.
@Corillian Could you check if my branch https://github.com/jakob/libssh2/tree/sftp-read-fix (see pull request #75) fixes your issues?
from libssh2.
That fix is now merged into master and we believe this bug is fixed. Please provide details if not.
from libssh2.
Related Issues (20)
- I am trying to compile libssh2 as a static library with openSSL 3 but I am getting a of LNK errors in WINDOWS with cmake. HOT 2
- Add support for "strict KEX" protocol extension HOT 1
- Release request (terrapin) HOT 1
- Make a new release to include fix for CVE-2023-48795 HOT 1
- libssh2 1.11.1 release? (with CVE-2023-48795 fix)
- Encryption failure during handshake when using libssh2 and wolfssl HOT 7
- How can I get more descriptive error messages?
- ssh from docker container on arm64 macos ventura to same mac (docker host) fails, ERROR: SSH handshake failed. HOT 1
- (question) when is the terrapin fix going to be released? HOT 1
- libssh2 in PHP: how can I check the supported ciphers and mac algorithms HOT 1
- compilation error with cmake, without passing -DENABLE_ZLIB_COMPRESSION=ON HOT 2
- Unused code setting channel ignore mode HOT 3
- After running this code, the memory usage continuously spikes. What could be the reason? libssh2-1.10.0 HOT 9
- KEX extension indicators are lost in libssh2_session_method_pref() HOT 3
- libssh2 tests are failing HOT 1
- Encrypt-then-MAC feature should be tested in remote end's configuration when receiving data
- Fix AIX build HOT 1
- SFTP failed with the error -41 working with Openssl HOT 9
- libssh2_session_handshake() hangs HOT 3
- libssh2_session_handshake LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libssh2.