bin/127194: [PATCH] arpa/telnet.h: TELOPT(x) returns wrong result /
segfaults
Joost Bekkers
joost at jodocus.org
Sun Sep 7 20:40:02 UTC 2008
>Number: 127194
>Category: bin
>Synopsis: [PATCH] arpa/telnet.h: TELOPT(x) returns wrong result / segfaults
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Sep 07 20:40:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Joost Bekkers
>Release: FreeBSD 7.0-RELEASE-p4 amd64
>Organization:
>Environment:
System: FreeBSD bps.jodocus.org 7.0-RELEASE-p4 FreeBSD 7.0-RELEASE-p4 #3: Wed Sep 3 23:33:23 CEST 2008 joost at bps.jodocus.org:/usr/src/sys/amd64/compile/bps amd64
>Description:
The telnet options added to src/contrib/telnet/arpa/telnet.h in rev
1.9 (==RELENG_5_2_0_RELEASE==HEAD) were discontinuous, but names
were added to telopts[] without the corresponding gaps. This can cause
TELOPT to return pointers outside of telopts[] even though TELOPT_OK
returns 'true'.
>How-To-Repeat:
#include <stdio.h>
#define TELOPTS
#include <arpa/telnet.h>
int main(int argc,char *argv[]) {
unsigned int opt;
opt=TELOPT_KERMIT;
if (TELOPT_OK(opt))
printf("Option name:%s\n",TELOPT(opt));
else
printf("Unknown option %d\n",opt);
return 0;
}
depending on your luck, this either tells you the option is "(null)" or segfaults.
>Fix:
--- telnet.h.org 2008-09-07 21:45:53.000000000 +0200
+++ telnet.h 2008-09-07 22:12:19.000000000 +0200
@@ -140,8 +140,8 @@
"TACACS UID", "OUTPUT MARKING", "TTYLOC",
"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
- "ENCRYPT", "NEW-ENVIRON", "TN3270E", "CHARSET", "COM-PORT",
- "KERMIT",
+ "ENCRYPT", "NEW-ENVIRON", "TN3270E", "XAUTH", "CHARSET",
+ "RSP", "COM-PORT", "SLE", "STARTTLS", "KERMIT",
0
};
#define TELOPT_FIRST TELOPT_BINARY
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list