diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-21 15:25:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-21 15:25:20 +0000 |
commit | 29e867868b244a1a018e17c7ec4c9f3b72a4a7fc (patch) | |
tree | f1a037945c7577b8c1f0538729a48d02e689a416 /usr.sbin/bgpd | |
parent | 2ecfb0181f97bb43fa4a3e45c751b2f50e2d2e18 (diff) |
Check for overflow of others_len. This can not happen at the moment because
less than 255 attributes can be allocated at max. OK claudio@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/rde_attr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde_attr.c b/usr.sbin/bgpd/rde_attr.c index 65ae8b440c4..f27cc53950e 100644 --- a/usr.sbin/bgpd/rde_attr.c +++ b/usr.sbin/bgpd/rde_attr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_attr.c,v 1.67 2006/12/18 19:16:59 henning Exp $ */ +/* $OpenBSD: rde_attr.c,v 1.68 2006/12/21 15:25:19 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -143,6 +143,9 @@ attr_optadd(struct rde_aspath *asp, u_int8_t flags, u_int8_t type, } /* no empty slot found, need to realloc */ + if (asp->others_len == UCHAR_MAX) + fatalx("attr_optadd: others_len overflow"); + asp->others_len++; if ((p = realloc(asp->others, asp->others_len * sizeof(struct attr *))) == NULL) |