From: Keir Fraser <keir.xen@gmail.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] common/vsprintf: fix return value when formatting symbolic addresses
Date: Mon, 02 Dec 2013 15:23:36 +0000 [thread overview]
Message-ID: <CEC25678.683EA%keir.xen@gmail.com> (raw)
In-Reply-To: <529C8611.6060301@citrix.com>
On 02/12/2013 13:07, "Andrew Cooper" <andrew.cooper3@citrix.com> wrote:
> 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>
Acked-by: Keir Fraser <keir@xen.org>
>>
>> --- 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);
>> }
>>
>>
>>
>>
>
>
prev parent reply other threads:[~2013-12-02 15:23 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
2013-12-02 15:23 ` Keir Fraser [this message]
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=CEC25678.683EA%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).