From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] common/vsprintf: fix return value when formatting symbolic addresses
Date: Mon, 2 Dec 2013 13:07:29 +0000 [thread overview]
Message-ID: <529C8611.6060301@citrix.com> (raw)
In-Reply-To: <529C85D50200007800108AE7@nat28.tlf.novell.com>
On 02/12/13 12:06, Jan Beulich wrote:
> When the buffer to be formatted to is too small, the function return
> value is expected to be the number of characters that would be printed
> (particularly important if that value is then used for allocating a
> buffer). Hence incrementing the active pointer must always be
> independent of actually storing a character.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/common/vsprintf.c
> +++ b/xen/common/vsprintf.c
> @@ -294,6 +294,7 @@ static char *pointer(char *str, char *en
> /* Print '+<offset>/<len>' */
> str = number(str, end, sym_offset, 16, -1, -1, SPECIAL|SIGN|PLUS);
> if ( str <= end )
> - *str++ = '/';
> + *str = '/';
> + ++str;
> str = number(str, end, sym_size, 16, -1, -1, SPECIAL);
> }
>
>
>
>
next prev parent reply other threads:[~2013-12-02 13:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 12:06 [PATCH] common/vsprintf: fix return value when formatting symbolic addresses Jan Beulich
2013-12-02 13:07 ` Andrew Cooper [this message]
2013-12-02 15:23 ` Keir Fraser
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=529C8611.6060301@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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.