summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormillert <>1998-03-17 06:18:48 +0000
committermillert <>1998-03-17 06:18:48 +0000
commit0b88976574adfae99a53e24c99a4df8c242d0632 (patch)
tree0cf84033057bca739090253ea43f460414f95a8d /src
parent355364933bc88bd48fdb07c2295844567e142748 (diff)
downloadopenbsd-0b88976574adfae99a53e24c99a4df8c242d0632.tar.gz
openbsd-0b88976574adfae99a53e24c99a4df8c242d0632.tar.bz2
openbsd-0b88976574adfae99a53e24c99a4df8c242d0632.zip
hostname buffer will not overflow if it is size MAXHOSTNAMELEN.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/net/ethers.317
1 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/libc/net/ethers.3 b/src/lib/libc/net/ethers.3
index 55e34ce4f0..12cc230a8a 100644
--- a/src/lib/libc/net/ethers.3
+++ b/src/lib/libc/net/ethers.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ethers.3,v 1.6 1998/02/27 12:13:27 deraadt Exp $ 1.\" $OpenBSD: ethers.3,v 1.7 1998/03/17 06:18:48 millert Exp $
2.\" 2.\"
3.\" Written by roland@frob.com. Public domain. 3.\" Written by roland@frob.com. Public domain.
4.\" 4.\"
@@ -56,7 +56,10 @@ addresses,
56The 56The
57.Fn ether_ntohost 57.Fn ether_ntohost
58function looks up the given Ethernet address and writes the associated 58function looks up the given Ethernet address and writes the associated
59host name into the character buffer passed. 59host name into the character buffer passed. This buffer should be
60.Ev
61MAXHOSTNAMELEN
62characters in size.
60The 63The
61.Fn ether_hostton 64.Fn ether_hostton
62function looks up the given host name and writes the associated 65function looks up the given host name and writes the associated
@@ -81,6 +84,10 @@ function parses a line from the
81file and fills in the passed ``struct ether_addr'' and character 84file and fills in the passed ``struct ether_addr'' and character
82buffer with the Ethernet address and host name on the line. It 85buffer with the Ethernet address and host name on the line. It
83returns zero if the line was successfully parsed and -1 if not. 86returns zero if the line was successfully parsed and -1 if not.
87The character buffer buffer should be
88.Ev
89MAXHOSTNAMELEN
90characters in size.
84.Sh FILES 91.Sh FILES
85.Bl -tag -width /etc/ethers -compact 92.Bl -tag -width /etc/ethers -compact
86.It Pa /etc/ethers 93.It Pa /etc/ethers
@@ -100,8 +107,4 @@ NetBSD 0.9b.
100.Sh BUGS 107.Sh BUGS
101The data space used by these functions is static; if future use 108The data space used by these functions is static; if future use
102requires the data, it should be copied before any subsequent calls to 109requires the data, it should be copied before any subsequent calls to
103these functions overwrite it. There is no way to restrict how many 110these functions overwrite it.
104character will be written into the host name buffer passed. A very
105long line in
106.Pa /etc/ethers
107could overflow your buffer.