From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target/ppc: fix compile error in kvmppc_define_rtas_kernel_token()
Date: Tue, 18 Jun 2019 18:08:12 +1000 [thread overview]
Message-ID: <20190618080812.GA3673@umbus.BigPond> (raw)
In-Reply-To: <20190615081252.28602-1-clg@kaod.org>
[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]
On Sat, Jun 15, 2019 at 10:12:52AM +0200, Cédric Le Goater wrote:
> gcc9 reports :
>
> In file included from /usr/include/string.h:494,
> from ./include/qemu/osdep.h:101,
> from ./target/ppc/kvm.c:17:
> In function ‘strncpy’,
> inlined from ‘kvmppc_define_rtas_kernel_token’ at ./target/ppc/kvm.c:2648:5:
> /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 120 equals destination size [-Werror=stringop-truncation]
> 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Applied to ppc-for-4.1, thanks.
> ---
> target/ppc/kvm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
> index d4107dd70d21..9edf4abeaae7 100644
> --- a/target/ppc/kvm.c
> +++ b/target/ppc/kvm.c
> @@ -2645,7 +2645,7 @@ int kvmppc_define_rtas_kernel_token(uint32_t token, const char *function)
> return -ENOENT;
> }
>
> - strncpy(args.name, function, sizeof(args.name));
> + strncpy(args.name, function, sizeof(args.name) - 1);
>
> return kvm_vm_ioctl(kvm_state, KVM_PPC_RTAS_DEFINE_TOKEN, &args);
> }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2019-06-18 8:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-15 8:12 [Qemu-devel] [PATCH] target/ppc: fix compile error in kvmppc_define_rtas_kernel_token() Cédric Le Goater
2019-06-18 8:08 ` David Gibson [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=20190618080812.GA3673@umbus.BigPond \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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).