From patchwork Mon Jan 11 13:32:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 59494 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2113352lbb; Mon, 11 Jan 2016 05:35:46 -0800 (PST) X-Received: by 10.140.28.161 with SMTP id 30mr158716144qgz.36.1452519346491; Mon, 11 Jan 2016 05:35:46 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v11si13640723qkl.64.2016.01.11.05.35.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jan 2016 05:35:46 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:54217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIcdO-00051m-3e for patch@linaro.org; Mon, 11 Jan 2016 08:35:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIcb1-0001u4-BZ for qemu-devel@nongnu.org; Mon, 11 Jan 2016 08:33:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIcax-0006YB-Ey for qemu-devel@nongnu.org; Mon, 11 Jan 2016 08:33:19 -0500 Received: from vms173017pub.verizon.net ([206.46.173.17]:49236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIcax-0006Xe-8b for qemu-devel@nongnu.org; Mon, 11 Jan 2016 08:33:15 -0500 Received: from serve.minyard.net ([173.57.176.17]) by vms173017.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0O0S00B9FIYFDV60@vms173017.mailsrvcs.net> for qemu-devel@nongnu.org; Mon, 11 Jan 2016 07:32:49 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=WcjxEBVX c=1 sm=1 tr=0 a=bXmWQgKa9n63w7XTPFb8JQ==:117 a=N54-gffFAAAA:8 a=HL3alpDKAAAA:8 a=oR5dmqMzAAAA:8 a=7aQ_Q-yQQ-AA:10 a=fk1lIlRQAAAA:8 a=20KFwNOVAAAA:8 a=KKAkSRfTAAAA:8 a=i0EeH86SAAAA:8 a=QyXUC8HyAAAA:8 a=0Mptf0FKmR1DuNcFTEMA:9 Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id 06C8478; Mon, 11 Jan 2016 07:32:39 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id C955C3027F5; Mon, 11 Jan 2016 07:32:38 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org Date: Mon, 11 Jan 2016 07:32:31 -0600 Message-id: <1452519152-6500-2-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.5.0 In-reply-to: <1452519152-6500-1-git-send-email-minyard@acm.org> References: <1452519152-6500-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.46.173.17 Cc: Peter Maydell , Xiao Guangrong , Corey Minyard , "Michael S. Tsirkin" , Stefan Hajnoczi , Shannon Zhao , Paolo Bonzini Subject: [Qemu-devel] [PATCH 1/2] ipmi_bmc_sim: Fix off by one in check. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Corey Minyard Found by Paolo. Cc: Paolo Bonzini Cc: Michael S. Tsirkin Cc: Peter Maydell Cc: Shannon Zhao Cc: Xiao Guangrong Cc: Stefan Hajnoczi Signed-off-by: Corey Minyard --- hw/ipmi/ipmi_bmc_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.0 diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 0a59e53..3ecf02e 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -546,7 +546,7 @@ static void ipmi_init_sensors_from_sdrs(IPMIBmcSim *s) static int ipmi_register_netfn(IPMIBmcSim *s, unsigned int netfn, const IPMINetfn *netfnd) { - if ((netfn & 1) || (netfn > MAX_NETFNS) || (s->netfns[netfn / 2])) { + if ((netfn & 1) || (netfn >= MAX_NETFNS) || (s->netfns[netfn / 2])) { return -1; } s->netfns[netfn / 2] = netfnd;