diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2000-11-19 10:01:27 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2000-11-19 10:01:27 +0000 |
commit | 75dd9c65fa2e4b80cc3637ab06e1839359f18dc7 (patch) | |
tree | 9195b0802a3efc9a38b75acdc244ded9a22f1b03 /libexec | |
parent | fa2fbc3dac06563e03b36fb01d91d052a87eda44 (diff) | |
download | src-75dd9c65fa2e4b80cc3637ab06e1839359f18dc7.tar.gz src-75dd9c65fa2e4b80cc3637ab06e1839359f18dc7.zip |
Don't use sizeof() on a pointer when we really wanted to measure
the length of the array.
Noticed by: Christos Zoulas <christos@ZOULAS.COM>
Obtained from: OpenBSD
Notes
Notes:
svn path=/head/; revision=68890
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/telnetd/ext.h | 2 | ||||
-rw-r--r-- | libexec/telnetd/sys_term.c | 10 | ||||
-rw-r--r-- | libexec/telnetd/telnetd.c | 1 |
3 files changed, 4 insertions, 9 deletions
diff --git a/libexec/telnetd/ext.h b/libexec/telnetd/ext.h index bce0e2a71aef..98e74b7f7eeb 100644 --- a/libexec/telnetd/ext.h +++ b/libexec/telnetd/ext.h @@ -87,7 +87,7 @@ extern char *unptyip; /* pointer to remaining characters in buffer */ #endif extern int pty, net; -extern char *line; +extern char line[16]; extern int SYNCHing; /* we are in TELNET SYNCH mode */ #ifndef P diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index 332dddc46b04..306449a61762 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -480,14 +480,10 @@ getnpty() * * Returns the file descriptor of the opened pty. */ -#ifndef __GNUC__ -char *line = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -#else -static char Xline[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -char *line = Xline; -#endif #ifdef CRAY -char *myline = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; +char myline[16]; +#else +char line[16]; #endif /* CRAY */ int diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c index 9158dfb1d801..7216cf72c14e 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -805,7 +805,6 @@ doit(who) #else for (;;) { char *lp; - extern char *line, *getpty(); if ((lp = getpty()) == NULL) fatal(net, "Out of ptys"); |