From: Hal Rosenstock Subject: [PATCH opensm] osm_helper.c: Fix out-of-bounds read Date: Thu, 22 Aug 2013 10:54:09 -0400 Message-ID: <52162611.7050903@dev.mellanox.co.il> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)" Cc: Dan Ben-Yosef , Alex Netes List-Id: linux-rdma@vger.kernel.org From: Dan Ben Yosef Overrunning static array "disp_msg_str", with 35 elements, at position 35 with index variable "msg". Signed-off-by: Dan Ben Yosef Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock --- opensm/osm_helper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opensm/osm_helper.c b/opensm/osm_helper.c index d31d088..55f0637 100644 --- a/opensm/osm_helper.c +++ b/opensm/osm_helper.c @@ -2941,8 +2941,8 @@ static const char *disp_msg_str[] = { const char *osm_get_disp_msg_str(IN cl_disp_msgid_t msg) { - if (msg > OSM_MSG_MAX) - msg = OSM_MSG_MAX; + if (msg >= OSM_MSG_MAX) + msg = OSM_MSG_MAX-1; return disp_msg_str[msg]; } -- 1.7.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html