FreeBSD Bugzilla – Attachment 132075 Details for
Bug 176278
[patch] nc(1) incorrectly passes telnet option data through
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.81 KB, created by
Paul Koch
on 2013-02-20 03:10:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Paul Koch
Created:
2013-02-20 03:10:00 UTC
Size:
1.81 KB
patch
obsolete
>--- netcat.c 2013-02-20 12:46:17.000000000 +1000 >+++ netcat.c.orig 2013-02-20 13:03:50.000000000 +1000 >@@ -25,7 +25,7 @@ > * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > * >- * $FreeBSD: stable/9/contrib/netcat/netcat.c 243818 2012-12-03 18:26:23Z delphij $ >+ * $FreeBSD$ > */ > > /* >@@ -100,7 +100,7 @@ > char *portlist[PORT_MAX+1]; > char *unix_dg_tmp_socket; > >-int atelnet(int, unsigned char *, unsigned int); >+void atelnet(int, unsigned char *, unsigned int); > void build_ports(char *); > void help(void); > int local_listen(char *, char *, struct addrinfo); >@@ -823,7 +823,7 @@ > pfd[0].events = 0; > } else { > if (tflag) >- n = atelnet(nfd, buf, n); >+ atelnet(nfd, buf, n); > if (atomicio(vwrite, lfd, buf, n) != n) > return; > } >@@ -845,23 +845,20 @@ > } > > /* Deal with RFC 854 WILL/WONT DO/DONT negotiation. */ >-int >+void > atelnet(int nfd, unsigned char *buf, unsigned int size) > { >- unsigned char *p, *q, *end; >+ unsigned char *p, *end; > unsigned char obuf[4]; >- int compact = 0; > > if (size < 3) >- return size; >+ return; > end = buf + size - 2; > > for (p = buf; p < end; p++) { > if (*p != IAC) > continue; > >- compact = 1; >- > obuf[0] = IAC; > p++; > if ((*p == WILL) || (*p == WONT)) >@@ -876,20 +873,6 @@ > if (atomicio(vwrite, nfd, obuf, 3) != 3) > warn("Write Error!"); > } >- >- if (compact) { >- p = q = buf; >- end = buf + size; >- while (p < end) { >- if (*p == IAC) >- p += 3; /* skip over telnet opt */ >- else >- *q++ = *p++; >- } >- size = q - buf; >- } >- >- return size; > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 176278
: 132075