From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFmx5-0005jk-M5 for qemu-devel@nongnu.org; Tue, 18 Feb 2014 10:51:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFmwt-0007Xq-Uk for qemu-devel@nongnu.org; Tue, 18 Feb 2014 10:51:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFmwt-0007XT-Ek for qemu-devel@nongnu.org; Tue, 18 Feb 2014 10:51:07 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1IFp5WS009491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Feb 2014 10:51:06 -0500 From: Gerd Hoffmann Date: Tue, 18 Feb 2014 16:50:49 +0100 Message-Id: <1392738654-4698-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1392738654-4698-1-git-send-email-kraxel@redhat.com> References: <1392738654-4698-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/7] xhci: fix overflow in usb_xhci_post_load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Found by Coverity. Reported-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 0fa814e..8d9cfe8 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3636,7 +3636,7 @@ static int usb_xhci_post_load(void *opaque, int version_id) slot->uport = xhci_lookup_uport(xhci, slot_ctx); assert(slot->uport && slot->uport->dev); - for (epid = 1; epid <= 32; epid++) { + for (epid = 1; epid <= 31; epid++) { pctx = slot->ctx + 32 * epid; xhci_dma_read_u32s(xhci, pctx, ep_ctx, sizeof(ep_ctx)); state = ep_ctx[0] & EP_STATE_MASK; -- 1.8.3.1