Quantcast
Channel: All Open Tickets - Tera Term on OSDN
Viewing all articles
Browse latest Browse all 2128

YModem receive fails if sender doesn't send file size - Tera Term Ticket #34235 on OSDN

$
0
0

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 - MediumMileStone:Tera Term 4.86 (closed)
Type:BugsSeverity:5 - Medium
Component:Tera TermStatus:Closed
ResolutionNone

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:

ls -l | sz --ymodem -

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; } }

--> since nameend points to an ASCII NUL, the fv->FileSize will stay 0

if (fv->ByteCount + c > fv->FileSize) { c = fv->FileSize - fv->ByteCount; }

--> since fv->FileSize and fv->ByteCount are zero, c is set to zero

if (yv->TextFlag>0)

else _lwrite(fv->FileHandle, &(yv->PktIn3), c);

--> no data is written to the output file

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.

Viewing all articles
Browse latest Browse all 2128