diff options
author | millert <> | 1998-03-17 06:18:48 +0000 |
---|---|---|
committer | millert <> | 1998-03-17 06:18:48 +0000 |
commit | 0b88976574adfae99a53e24c99a4df8c242d0632 (patch) | |
tree | 0cf84033057bca739090253ea43f460414f95a8d /src | |
parent | 355364933bc88bd48fdb07c2295844567e142748 (diff) | |
download | openbsd-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.3 | 17 |
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, | |||
56 | The | 56 | The |
57 | .Fn ether_ntohost | 57 | .Fn ether_ntohost |
58 | function looks up the given Ethernet address and writes the associated | 58 | function looks up the given Ethernet address and writes the associated |
59 | host name into the character buffer passed. | 59 | host name into the character buffer passed. This buffer should be |
60 | .Ev | ||
61 | MAXHOSTNAMELEN | ||
62 | characters in size. | ||
60 | The | 63 | The |
61 | .Fn ether_hostton | 64 | .Fn ether_hostton |
62 | function looks up the given host name and writes the associated | 65 | function looks up the given host name and writes the associated |
@@ -81,6 +84,10 @@ function parses a line from the | |||
81 | file and fills in the passed ``struct ether_addr'' and character | 84 | file and fills in the passed ``struct ether_addr'' and character |
82 | buffer with the Ethernet address and host name on the line. It | 85 | buffer with the Ethernet address and host name on the line. It |
83 | returns zero if the line was successfully parsed and -1 if not. | 86 | returns zero if the line was successfully parsed and -1 if not. |
87 | The character buffer buffer should be | ||
88 | .Ev | ||
89 | MAXHOSTNAMELEN | ||
90 | characters 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 |
101 | The data space used by these functions is static; if future use | 108 | The data space used by these functions is static; if future use |
102 | requires the data, it should be copied before any subsequent calls to | 109 | requires the data, it should be copied before any subsequent calls to |
103 | these functions overwrite it. There is no way to restrict how many | 110 | these functions overwrite it. |
104 | character will be written into the host name buffer passed. A very | ||
105 | long line in | ||
106 | .Pa /etc/ethers | ||
107 | could overflow your buffer. | ||