Fix OBOB in IP timestamp option processing, as noted in FreeBSD PR 6738,
from Jennifer Dawn Meyers <jdm@enteract.com>.
This commit is contained in:
parent
3759ec18f5
commit
f555f6d93f
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ip_input.c,v 1.65 1998/05/04 19:24:53 matt Exp $ */
|
/* $NetBSD: ip_input.c,v 1.66 1998/05/24 20:14:53 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -891,7 +891,7 @@ ip_dooptions(m)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IPOPT_TS_TSANDADDR:
|
case IPOPT_TS_TSANDADDR:
|
||||||
if (ipt->ipt_ptr + sizeof(n_time) +
|
if (ipt->ipt_ptr - 1 + sizeof(n_time) +
|
||||||
sizeof(struct in_addr) > ipt->ipt_len)
|
sizeof(struct in_addr) > ipt->ipt_len)
|
||||||
goto bad;
|
goto bad;
|
||||||
ipaddr.sin_addr = dst;
|
ipaddr.sin_addr = dst;
|
||||||
|
@ -905,7 +905,7 @@ ip_dooptions(m)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IPOPT_TS_PRESPEC:
|
case IPOPT_TS_PRESPEC:
|
||||||
if (ipt->ipt_ptr + sizeof(n_time) +
|
if (ipt->ipt_ptr - 1 + sizeof(n_time) +
|
||||||
sizeof(struct in_addr) > ipt->ipt_len)
|
sizeof(struct in_addr) > ipt->ipt_len)
|
||||||
goto bad;
|
goto bad;
|
||||||
bcopy((caddr_t)sin, (caddr_t)&ipaddr.sin_addr,
|
bcopy((caddr_t)sin, (caddr_t)&ipaddr.sin_addr,
|
||||||
|
|
Loading…
Reference in New Issue