From: Ben Pfaff Date: Tue, 30 Dec 2008 18:48:59 +0000 (-0800) Subject: Fix off-by-one error in looking up datapaths by index. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93b8eab4d754d7aef2b90f28cd99ddc275279008;p=openvswitch Fix off-by-one error in looking up datapaths by index. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index dbd0628d..2677445f 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1127,7 +1127,7 @@ static struct genl_ops dp_genl_ops_add_dp = { struct datapath *dp_get_by_idx(int dp_idx) { - if (dp_idx < 0 || dp_idx > DP_MAX) + if (dp_idx < 0 || dp_idx >= DP_MAX) return NULL; return rcu_dereference(dps[dp_idx]); }