summaryrefslogtreecommitdiff
path: root/usr.sbin/npppd/pppoe
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2010-01-27 07:27:03 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2010-01-27 07:27:03 +0000
commitfc268ae826642befd89b4cbd94448e4d6494c75c (patch)
treed73edd294a63cdeb0c3c3ba7faba6a1e1bf59aeb /usr.sbin/npppd/pppoe
parent5352dc72322ef20069415c701f9d33341165f686 (diff)
Fixed 2 off-by-one problems.
(found by parfait, reported by jsg@)
Diffstat (limited to 'usr.sbin/npppd/pppoe')
-rw-r--r--usr.sbin/npppd/pppoe/pppoed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/npppd/pppoe/pppoed.c b/usr.sbin/npppd/pppoe/pppoed.c
index fdb99fad419..35f75d1bb3b 100644
--- a/usr.sbin/npppd/pppoe/pppoed.c
+++ b/usr.sbin/npppd/pppoe/pppoed.c
@@ -29,7 +29,7 @@
* <dt>RFC 2516</dt>
* <dd>A Method for Transmitting PPP Over Ethernet (PPPoE)</dd>
* </dl>
- * $Id: pppoed.c,v 1.2 2010/01/13 07:49:44 yasuoka Exp $
+ * $Id: pppoed.c,v 1.3 2010/01/27 07:27:02 yasuoka Exp $
*/
#include <sys/types.h>
#include <sys/param.h>
@@ -970,7 +970,7 @@ pppoed_recv_PADI(pppoed_listener *_this, uint8_t shost[ETHER_ADDR_LEN],
if (tlv0->type == PPPOE_TAG_SERVICE_NAME) {
len = tlv0->length;
- if (len > sizeof(sn))
+ if (len >= sizeof(sn))
goto reigai;
memcpy(sn, tlv0->value, len);