Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'libssh2_sftp_read.vi' reads incomplete data if the buffer contains null characters. #4

Closed
sanch3z opened this issue Jul 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sanch3z
Copy link

sanch3z commented Jul 8, 2024

Hi,

when you read a binary file via SFTP, then chunks that contain the null character are incomplete.

Is this possibly due to how LabVIEW converts C strings to LV strings?

Best regards
sanch3z

@logmanoriginal logmanoriginal added the bug Something isn't working label Sep 20, 2024
@logmanoriginal
Copy link
Owner

Good catch, thanks for the report.

logmanoriginal added a commit that referenced this issue Sep 20, 2024
The CLFN expects strings to be null-terminated. This causes the string
to be prematurely terminated when the source file contains a null-bytes.

This is fixed by reading the data into an intermediate buffer as an
array of bytes that is later cast into a string.

References #4
@logmanoriginal
Copy link
Owner

This issue is fixed in the main branch. Thanks again for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants