From: Yuval Shaia <yuval.shaia@oracle.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] rdmacm-mux: fix strcpy string warning
Date: Fri, 2 Aug 2019 05:57:41 +0300 [thread overview]
Message-ID: <20190802025740.GA4271@lap1> (raw)
In-Reply-To: <20190716100719.29722-1-marcandre.lureau@redhat.com>
On Tue, Jul 16, 2019 at 02:07:18PM +0400, Marc-André Lureau wrote:
> ../contrib/rdmacm-mux/main.c: In function ‘parse_args’:
> ../contrib/rdmacm-mux/main.c:118:13: error: ‘strncpy’ specified bound 3835 equals destination size [-Werror=stringop-truncation]
> 118 | strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX);
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> contrib/rdmacm-mux/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c
> index 30c7052651..de53048f06 100644
> --- a/contrib/rdmacm-mux/main.c
> +++ b/contrib/rdmacm-mux/main.c
> @@ -115,7 +115,7 @@ static void parse_args(int argc, char *argv[])
>
> case 's':
> /* This is temporary, final name will build below */
> - strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX);
> + strncpy(unix_socket_path, optarg, SOCKET_PATH_MAX - 1);
> break;
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
>
> case 'p':
> --
> 2.22.0.428.g6d5b264208
>
prev parent reply other threads:[~2019-08-02 2:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 10:07 [Qemu-devel] [PATCH 1/2] rdmacm-mux: fix strcpy string warning Marc-André Lureau
2019-07-16 10:08 ` Marc-André Lureau
2019-08-02 2:57 ` Yuval Shaia [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=20190802025740.GA4271@lap1 \
--to=yuval.shaia@oracle.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@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).