summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2020-03-11 07:01:42 +0000
committerdlg <dlg@openbsd.org>2020-03-11 07:01:42 +0000
commit91f5d55b6b302ef3c66a5b478fad567f3232f9b0 (patch)
treef91d009241b057b3879cbecde5516280c15eb397 /sys
parentMake traphandler_parse also set vbinds for SNMPv1 traps. (diff)
downloadwireguard-openbsd-91f5d55b6b302ef3c66a5b478fad567f3232f9b0.tar.xz
wireguard-openbsd-91f5d55b6b302ef3c66a5b478fad567f3232f9b0.zip
properly limit indexing into the aggr_periodic_times array.
coverity CID 1486819 pointed out by and ok tobhe@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_aggr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/if_aggr.c b/sys/net/if_aggr.c
index cc35fa8d994..10cc3c66b8d 100644
--- a/sys/net/if_aggr.c
+++ b/sys/net/if_aggr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aggr.c,v 1.27 2019/12/23 09:03:24 dlg Exp $ */
+/* $OpenBSD: if_aggr.c,v 1.28 2020/03/11 07:01:42 dlg Exp $ */
/*
* Copyright (c) 2019 The University of Queensland
@@ -1022,8 +1022,7 @@ aggr_set_options(struct aggr_softc *sc, const struct trunk_opts *tro)
break;
case TRUNK_OPT_LACP_TIMEOUT:
- if (opt->lacp_timeout > nitems(aggr_periodic_times) ||
- aggr_periodic_times[opt->lacp_timeout] == 0)
+ if (opt->lacp_timeout >= nitems(aggr_periodic_times))
return (EINVAL);
aggr_set_lacp_timeout(sc, opt->lacp_timeout);