All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: xen-devel@lists.xensource.com
Cc: Keir Fraser <keir@xensource.com>
Subject: Re: [Xen-staging] [xen-unstable] Clean up arch_get_xen_caps() to not use sprintf().
Date: Tue, 30 Jan 2007 23:20:01 -0700	[thread overview]
Message-ID: <1170224401.10792.116.camel@bling> (raw)
In-Reply-To: <200701301624.l0UGOJuF027110@latara.uk.xensource.com>

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.

       reply	other threads:[~2007-01-31  6:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200701301624.l0UGOJuF027110@latara.uk.xensource.com>
2007-01-31  6:20 ` Alex Williamson [this message]
2007-01-31  6:31   ` Re: [Xen-staging] [xen-unstable] Clean up arch_get_xen_caps() to not use sprintf() Alex Williamson
2007-01-31 10:12     ` Ian Campbell
2007-01-31  9:41   ` about eventchannel tgh
2007-01-31 20:47     ` Mark Williamson
2007-02-01  4:08       ` Tian, Kevin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1170224401.10792.116.camel@bling \
    --to=alex.williamson@hp.com \
    --cc=keir@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.