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

Re: [Xen-devel] [PATCH 1 of 4] Fix off-by-one preventing the last elfnot

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 4] Fix off-by-one preventing the last elfnote from being read in xc.c
From: Brendan Cully <brendan@xxxxxxxxx>
Date: Wed, 28 Feb 2007 08:20:56 -0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 28 Feb 2007 08:20:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1172653609.20600.21.camel@xxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Ian.Campbell@xxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <a7afd4050ce3201044ac.1172644700@xxxxxxxxxxxxxxxxx> <1172653609.20600.21.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.14 (2007-02-24)
On Wednesday, 28 February 2007 at 09:06, Ian Campbell wrote:
> On Tue, 2007-02-27 at 22:38 -0800, Brendan Cully wrote:
> > # HG changeset patch
> > # User Brendan Cully <brendan@xxxxxxxxx>
> > # Date 1172644688 28800
> > # Node ID a7afd4050ce3201044ac8fec1b4469d758a0fc80
> > # Parent  1c5e6239a8d0381fdbf56d4926f986d7f0ec07c0
> > Fix off-by-one preventing the last elfnote from being read in xc.c.
> > 
> > Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>
> > 
> > diff -r 1c5e6239a8d0 -r a7afd4050ce3 tools/python/xen/lowlevel/xc/xc.c
> > +++ b/tools/python/xen/lowlevel/xc/xc.c     Tue Feb 27 22:38:08 2007 -0800
> > @@ -411,7 +411,7 @@ static PyObject *pyxc_linux_build(XcObje
> >  
> >      if (!(elfnote_dict = PyDict_New()))
> >     goto out;
> > -    for (i = 0; i < XEN_ELFNOTE_MAX; i++) {
> > +    for (i = 0; i <= XEN_ELFNOTE_MAX; i++) {
> >     switch (dom->parms.elf_notes[i].type) {
> >     case XEN_ENT_NONE:
> >         continue;
> 
> I think we should rename XEN_ELFNOTE_MAX to XEN_ELFNOTE_NR (and +1)
> which would be clearer IMHO. The only other place it used is
> "XEN_ELFNOTE_MAX + 1" anyway:
> 
> Change XEN_ELFNOTE_MAX to XEN_ELFNOTE_NR and make it the number of ELF
> notes rather than the index of the last ELF note.

Sounds good to me.

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