summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-03-17 06:18:49 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-03-17 06:18:49 +0000
commitbeacdac860a6d5d8da6b331ceead8333e382cfe1 (patch)
treedcc31a7c54edd5be110b8da917d0ce380272ec3a
parent61b79ca0ca965ef507f31c304a85815a3c22456d (diff)
hostname buffer will not overflow if it is size MAXHOSTNAMELEN.
-rw-r--r--lib/libc/net/ethers.317
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libc/net/ethers.3 b/lib/libc/net/ethers.3
index 55e34ce4f05..12cc230a8a9 100644
--- a/lib/libc/net/ethers.3
+++ b/lib/libc/net/ethers.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ethers.3,v 1.6 1998/02/27 12:13:27 deraadt Exp $
+.\" $OpenBSD: ethers.3,v 1.7 1998/03/17 06:18:48 millert Exp $
.\"
.\" Written by roland@frob.com. Public domain.
.\"
@@ -56,7 +56,10 @@ addresses,
The
.Fn ether_ntohost
function looks up the given Ethernet address and writes the associated
-host name into the character buffer passed.
+host name into the character buffer passed. This buffer should be
+.Ev
+MAXHOSTNAMELEN
+characters in size.
The
.Fn ether_hostton
function looks up the given host name and writes the associated
@@ -81,6 +84,10 @@ function parses a line from the
file and fills in the passed ``struct ether_addr'' and character
buffer with the Ethernet address and host name on the line. It
returns zero if the line was successfully parsed and -1 if not.
+The character buffer buffer should be
+.Ev
+MAXHOSTNAMELEN
+characters in size.
.Sh FILES
.Bl -tag -width /etc/ethers -compact
.It Pa /etc/ethers
@@ -100,8 +107,4 @@ NetBSD 0.9b.
.Sh BUGS
The data space used by these functions is static; if future use
requires the data, it should be copied before any subsequent calls to
-these functions overwrite it. There is no way to restrict how many
-character will be written into the host name buffer passed. A very
-long line in
-.Pa /etc/ethers
-could overflow your buffer.
+these functions overwrite it.