Rare CR+LF conversion issue

Advertisement

Craigium
Joined:
Posts:
2
Location:
UK

Rare CR+LF conversion issue

When downloading files with CR+LF line endings from a Linux server in ASCII mode, extra CR bytes may occasionally be added incorrectly. This issue seems to occur when there are two consecutive CR+LF sequences located at specific offsets close to 32KB or any multiple of 32K.

Seems to be similar to these fixed issues,
Issue 1059 – Rare incorrect conversion of line endings and
Issue 845 – Rare incorrect conversion of line endings.

WinSCP version: 6.3.5 (also tested 6.4 beta and some older versions)
OS: Windows 10/11
Protocol: SFTP-3

Attached some files for testing.

Steps to reproduce:
  1. Upload one of the test files to Linux server in Binary mode
  2. Download it from Linux server in Text mode
  3. Compare to original file to see that additional CR byte(s) will have been added
Hope this explains the issue, let me know if you need me to test anything.
  • winscp.log (10.74 KB, Private file)
Description: Single 'x' character at start, then repeating CR+LF until end (this shows a CR byte being added at close to 32KB intervals (offsets 32,753 | 65,506 | 98,259 etc.) on download)
Description: 2 consecutive CR+LF are at offset 32,751 (shows single CR byte being added at offset 32,753 on download)

Reply with quote

Advertisement

Craigium

Thanks.
If it helps, I did a bit more investigating and found that it seems to happen when a CR+LF is split between SFTP data packets. One packet ends in x0D and the next packet (after overhead bytes) starts x0A. Looks like the fix for issue 1059 should have handled that, but my C++ knowledge is not great.

Reply with quote

Advertisement

You can post new topics in this forum