]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r338216:
authorasomers <asomers@FreeBSD.org>
Mon, 1 Oct 2018 16:04:07 +0000 (16:04 +0000)
committerasomers <asomers@FreeBSD.org>
Mon, 1 Oct 2018 16:04:07 +0000 (16:04 +0000)
commit6068c2761de987bc97d4c472acdc1076d91fc7e8
treee0bcc4a42b1297df31599b4349cd531362f68630
parentf7d345ffcd8dbcfc80b286a6ffb2545666884fdc
MFC r338216:

tftpd: Fix data corruption bug with netascii

Transferring files in netascii format requires, among other things,
translating all CR characters to a CR,NUL pair. tftpd does this correctly
except when the CR occurs as the last octet of a packet. In that case, it
erroneously drops the NUL which should be part of the following packet. The
bug was caused by using 0 as a sentinel value in a variable that could
legitimately hold 0. Fix it by switching the sentinel value to -1.

PR: 178055
Reported by: Richard <rsitze@gmail.com>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D16853
libexec/tftpd/tftp-file.c