Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] Clean up arch_get_xen_c

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-devel] Re: [Xen-staging] [xen-unstable] Clean up arch_get_xen_caps() to not use sprintf().
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Wed, 31 Jan 2007 10:12:32 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir@xxxxxxxxxxxxx>
Delivery-date: Wed, 31 Jan 2007 02:12:13 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1170225084.10792.118.camel@bling>
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>
References: <200701301624.l0UGOJuF027110@xxxxxxxxxxxxxxxxxxxxxxx> <1170224401.10792.116.camel@bling> <1170225084.10792.118.camel@bling>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2007-01-30 at 23:31 -0700, Alex Williamson wrote:
> On Tue, 2007-01-30 at 23:20 -0700, Alex Williamson wrote:
> > On Tue, 2007-01-30 at 16:24 +0000, Xen staging patchbot-unstable wrote:
> > > diff -r bd69e83b65ea -r 9578ae319874 xen/arch/ia64/xen/xensetup.c
> > > --- a/xen/arch/ia64/xen/xensetup.c        Tue Jan 30 16:14:16 2007 +0000
> > > +++ b/xen/arch/ia64/xen/xensetup.c        Tue Jan 30 16:23:43 2007 +0000
> > > @@ -547,18 +547,19 @@ printk("num_online_cpus=%d, max_cpus=%d\
> > >  
> > >  void arch_get_xen_caps(xen_capabilities_info_t info)
> > >  {
> > > -    char *p=info;
> > >      int major = xen_major_version();
> > >      int minor = xen_minor_version();
> > > -
> > > -    p += snprintf(p,sizeof(info), "xen-%d.%d-ia64 ", major, minor);
> > > +    char s[32];
> > > +
> > > +    info[0] = '\0';
> > > +
> > > +    snprintf(s, sizeof(s), "xen-%d.%d-ia54 ", major, minor);
> > > +    safe_strcat(info, s);
> > 
> >    This doesn't work.  info is just a char* here, so the sizeof() in
> > safe_strcat() only cats the first 8 bytes (or 4 on x86_32 I suppose).
> 
>    And there's a typo, ia64, not 54.  Thanks,

Fixed both of these, thanks for the heads up.

Ian.



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