]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r338216:
authorasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 1 Oct 2018 16:11:09 +0000 (16:11 +0000)
committerasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 1 Oct 2018 16:11:09 +0000 (16:11 +0000)
commit60dd668bf3575e6c00ff5fe88984816340c95aee
treee387b501f6adc67de95188e8ab8ee42c931d9bb6
parent22728ce87a81f04fee381b41c5220fba58ab8485
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

git-svn-id: svn://svn.freebsd.org/base/stable/10@339062 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
libexec/tftpd/tftp-file.c