From: Huawei Xie Date: Thu, 10 Dec 2015 17:57:16 +0000 (+0800) Subject: vhost: fix out-of-bounds read X-Git-Tag: spdx-start~7769 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=36b2449d86601d828883a23addad0dbb4cbd6630;p=dpdk.git vhost: fix out-of-bounds read CID 107126 (#1 OF 1): Out-of-bounds read Fixes: 8f972312b8f4 ("vhost: support vhost-user") Signed-off-by: Huawei Xie Acked-by: John McNamara --- diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c index 2dc054763e..549f9079e8 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");