Join GitHub today
Fix libssh2_sftp_read issues #75
I have reviewed sftp_read() and discovered 3 separate bugs that cause data corruption.
Two of them were introduced by d754fee
However, I don't think the bugs that I have fixed could cause memory corruption as initially reported by @Corillian, so we probably have to keep digging.
@jakob I applied your 3 patches "by hand" and they do not seem to change the situation here. I still need to keep the buffer size <= SFTP_MAX_READ_SIZE / 4 to avoid data corruption.
Using example-sftp with a 8k buffer and 10 byte remote file, my downloaded file is 0 bytes. Can you replicate this?
(I'm using ubuntu x64 client and server here).
referenced this pull request
Jan 15, 2016
Thanks a lot for your work. I also appreciate that we have gotten some testing on this patch set, as it makes me feel safer with merging it.
There are however a few nits on the style I think:
I still get this:
And please squash/fixup your code style fixes so that this patch set is only a series of logical fixes that fix existing problems, not problems within the patch series itself.