WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] blktap2: Fix off-by-one error in driver lookup

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] blktap2: Fix off-by-one error in driver lookup
From: Brendan Cully <brendan@xxxxxxxxx>
Date: Fri, 11 Sep 2009 13:05:29 -0700
Delivery-date: Fri, 11 Sep 2009 13:06:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/fef209e65757
# HG changeset patch
# User Brendan Cully <brendan@xxxxxxxxx>
# Date 1252699253 25200
# Node ID 92b42ec8a5677679e5841033544bf82606c3cfd3
# Parent  d2a32e24fe504b9626e6732b4f213c7cb1bc8b57
blktap2: Fix off-by-one error in driver lookup

diff --git a/tools/blktap2/drivers/tapdisk-server.c 
b/tools/blktap2/drivers/tapdisk-server.c
--- a/tools/blktap2/drivers/tapdisk-server.c
+++ b/tools/blktap2/drivers/tapdisk-server.c
@@ -53,7 +53,7 @@
        int n;
 
        n = sizeof(dtypes) / sizeof(struct disk_info_t *);
-       if (type > n)
+       if (type >= n)
                return NULL;
 
        return dtypes[type]->drv;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] blktap2: Fix off-by-one error in driver lookup, Brendan Cully <=