From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7920D8E7A for ; Fri, 11 Dec 2015 10:52:16 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 11 Dec 2015 01:52:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,412,1444719600"; d="scan'208";a="705382997" Received: from dpdk15.sh.intel.com ([10.239.129.25]) by orsmga003.jf.intel.com with ESMTP; 11 Dec 2015 01:52:13 -0800 From: Huawei Xie To: dev@dpdk.org Date: Fri, 11 Dec 2015 01:57:16 +0800 Message-Id: <1449770240-103240-2-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1449770240-103240-1-git-send-email-huawei.xie@intel.com> References: <1449770240-103240-1-git-send-email-huawei.xie@intel.com> X-Mailman-Approved-At: Fri, 11 Dec 2015 15:22:01 +0100 Subject: [dpdk-dev] [PATCH 1/4] vhost: Fix Coverity issue with possible array out-of-bounds read X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 09:52:16 -0000 CID 107126 (#1 OF 1): Out-of-bounds read Fixes: 8f972312b8f4 ("vhost: support vhost-user") Signed-off-by: Huawei Xie --- lib/librte_vhost/vhost_user/vhost-net-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c index 2dc0547..549f907 100644 --- a/lib/librte_vhost/vhost_user/vhost-net-user.c +++ b/lib/librte_vhost/vhost_user/vhost-net-user.c @@ -333,7 +333,7 @@ vserver_message_handler(int connfd, void *dat, int *remove) ctx.fh = cfd_ctx->fh; ret = read_vhost_message(connfd, &msg); - if (ret <= 0 || msg.request > VHOST_USER_MAX) { + if (ret <= 0 || msg.request >= VHOST_USER_MAX) { if (ret < 0) RTE_LOG(ERR, VHOST_CONFIG, "vhost read message failed\n"); -- 1.8.1.4