NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/53996: tip(1) fails to handle EOF on stdin

>Number:         53996
>Category:       bin
>Synopsis:       tip(1) fails to handle local EOF
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 20 17:25:00 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD 8.0

System: NetBSD
Architecture: x86_64
Machine: amd64

If the standard input to tip(1) ends (as in end-of-file, i.e. read()
returning 0), it fails to detect getchar() returning -1 and instead
interprets it as character with the value 0xFF, causing it to send
an endless stream of 0xFF characters (or possibly 0x7F depending on
parity settings) to the remote system.


Noticed while running tip with a pty as stdin/stdout using pexpect
(devel/py-pexpect in pkgsrc) and running ktruss -p on it while
debugging an unrelated issue.  Also obvious from inspection of the
getchar() call in tipin().


Home | Main Index | Thread Index | Old Index