YModem receive fails if sender doesn't send file size
Open Date: 2014-08-26 00:26
Letztes Update: 2015-02-02 13:10
Reporter: | (Anonymous) | Eigentümer: | (None) |
---|---|---|---|
Priority: | 5 - Medium | MileStone: | Tera Term 4.86 (closed) |
Type: | Bugs | Severity: | 5 - Medium |
Component: | Tera Term | Status: | Closed |
Resolution | None |
Details
Bug is reproducible in TeraTerm 4.83 (and IMO is in the current trunk too)
According to the YMODEM standard, the sending program may leave out the additional file info (for example, the file length) if it doesn't know it, for example if the sending side does something like this:
In that case, the lsz program is called in YMODEM mode and told to send its standard input (which is the output of a directory listing). Thus, it can't know in advance the file length. As per YMODEM standard, only the filename is set in the header packet, and the remaining bytes stay ASCII NULs.
In that case, the YReadPacket() function fails:
if (*nameend) { ret = sscanf(nameend, "%ld%lo%o", &bytes_total, &modtime, &mode); if (ret >= 1) { fv->FileSize = bytes_total; } if (ret >= 2) { fv->FileMtime = modtime; } }
if (fv->ByteCount + c > fv->FileSize) { c = fv->FileSize - fv->ByteCount; }
if (yv->TextFlag>0)
else _lwrite(fv->FileHandle, &(yv->PktIn3), c);
This code should be changed to leave out the filesize check if (fv->FileSize == 0)...
Last Update of this Ticket
2015-02-02 13:10 Update by: maya
- Ticket Close date set to 2015-02-02 13:10
- Status Update from Open to Closed.
Kommentar
fixed this issue.
http://ttssh2.sourceforge.jp/snapshot/snapshot-20150202.zip