diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-12-11 18:15:18 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-12-11 18:15:18 +0000 |
commit | f83dbda75719465dba083fe1e4f8a21a7b1fbba7 (patch) | |
tree | 17dfab9a0faaa178c5fb3a3d121c54d99e39b42b /usr.sbin/ppp | |
parent | 5d06c87bba398b9d5911a455d769be5f2e4d0dee (diff) |
Fix two identical buffer overruns.
found by parfait, my stupid mistake pointed out by miod, who also oked
this.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/ppp/ccp.c | 4 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/lcp.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ppp/ppp/ccp.c b/usr.sbin/ppp/ppp/ccp.c index ee82d28f28c..b1417c320b3 100644 --- a/usr.sbin/ppp/ppp/ccp.c +++ b/usr.sbin/ppp/ppp/ccp.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: ccp.c,v 1.32 2005/07/17 19:13:24 brad Exp $ + * $OpenBSD: ccp.c,v 1.33 2009/12/11 18:15:17 oga Exp $ */ #include <sys/param.h> @@ -133,7 +133,7 @@ protoname(int proto) "DEFLATE", /* 26: Deflate (rfc1979) */ }; - if (proto < 0 || proto > sizeof cftypes / sizeof *cftypes || + if (proto < 0 || proto >= sizeof cftypes / sizeof *cftypes || cftypes[proto] == NULL) { if (proto == -1) return "none"; diff --git a/usr.sbin/ppp/ppp/lcp.c b/usr.sbin/ppp/ppp/lcp.c index ceb578c79e1..d1da9ed38ed 100644 --- a/usr.sbin/ppp/ppp/lcp.c +++ b/usr.sbin/ppp/ppp/lcp.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: lcp.c,v 1.42 2006/12/11 16:31:35 claudio Exp $ + * $OpenBSD: lcp.c,v 1.43 2009/12/11 18:15:17 oga Exp $ */ #include <sys/param.h> @@ -146,7 +146,7 @@ protoname(int proto) "LDBACP", /* 23: Link Discriminator for BACP */ }; - if (proto < 0 || proto > sizeof cftypes / sizeof *cftypes || + if (proto < 0 || proto >= sizeof cftypes / sizeof *cftypes || cftypes[proto] == NULL) return HexStr(proto, NULL, 0); |