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] Re: [Xen-staging] [xen-unstable] Clean up arch_get_xen_caps(

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [Xen-staging] [xen-unstable] Clean up arch_get_xen_caps() to not use sprintf().
From: Alex Williamson <alex.williamson@xxxxxx>
Date: Tue, 30 Jan 2007 23:20:01 -0700
Cc: Keir Fraser <keir@xxxxxxxxxxxxx>
Delivery-date: Tue, 30 Jan 2007 22:24:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200701301624.l0UGOJuF027110@xxxxxxxxxxxxxxxxxxxxxxx>
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>
Organization: HP OSLO R&D
References: <200701301624.l0UGOJuF027110@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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).
Thanks,

        Alex

-- 
Alex Williamson                             HP Open Source & Linux Org.


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

<Prev in Thread] Current Thread [Next in Thread>