Bug 176278 - [patch] nc(1) incorrectly passes telnet option data through
Summary: [patch] nc(1) incorrectly passes telnet option data through
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-02-20 03:10 UTC by Paul Koch
Modified: 2022-10-17 12:36 UTC (History)
0 users

See Also:


Attachments
file.diff (1.81 KB, patch)
2013-02-20 03:10 UTC, Paul Koch
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Koch 2013-02-20 03:10:00 UTC
Run /usr/bin/nc -t {ip} 23

Garbage characters appear in output.

Run /usr/bin/nc -t {ip 23 | hexdump -C

This will show something like the following at the start:

 ff fd 25 ff fb 26 ff fd ...

The ff fd xx are telnet options which should be stripped from the output.

Telnet options can occur pretty much at any time during the session, so
garbage chars will probably also appear in other places of the output.

Fix: The telnet command opt processing in netcat.c is fairly crude.
Strip the telnet options from the output buffer.



Patch attached with submission follows:
How-To-Repeat: Run nc command as above.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:53 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:36:40 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>