Ticket #34235

YModem receive fails if sender doesn't send file size

Date d'ouverture: 2014-08-26 00:26 Dernière mise à jour: 2015-02-02 13:10

Rapporteur:
(Anonyme)
Propriétaire:
(Aucun)
Type:
État:
Atteints
Composant:
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Aucun
Fichier:
Aucun
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

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)...

Ticket History (3/3 Histories)

2014-08-26 00:26 Updated by: None
  • New Ticket "YModem receive fails if sender doesn't send file size" created
2014-11-30 00:47 Updated by: (del#1144)
2015-02-02 13:10 Updated by: (del#1144)
  • État Update from Ouvert to Atteints
  • Ticket Close date is changed to 2015-02-02 13:10
Commentaire

Attachment File List

No attachments

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion