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: http://git.onelab.eu/?a=commitdiff_plain;h=9e6a366f967581b41b7af9eb2ac0574340d3f307;hp=b9fddc9244da97d38b2fea80c69b0348a9b53d96;p=sliver-openvswitch.git Fix off-by-one error in looking up datapaths by index. --- diff --git a/datapath/datapath.c b/datapath/datapath.c index baf1d4056..9d0cea78d 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1125,7 +1125,7 @@ static struct genl_ops dp_genl_ops_add_dp = { struct datapath *dp_get(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]); }