public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, arnd@arndb.de
Subject: Re: [PATCH] IB/cma: use strlcpy() instead of strncpy()
Date: Fri, 12 Jan 2018 13:43:17 +0200	[thread overview]
Message-ID: <20180112114317.GL15760@mtr-leonro.local> (raw)
In-Reply-To: <1515743765-116090-1-git-send-email-wangxiongfeng2@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

On Fri, Jan 12, 2018 at 03:56:05PM +0800, Xiongfeng Wang wrote:
> From: Xiongfeng Wang <xiongfeng.wang@linaro.org>
>
> gcc-8 reports
>
> drivers/infiniband/core/cma_configfs.c: In function 'make_cma_dev':
> ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified
> bound 64 equals destination size [-Wstringop-truncation]
>
> We need to use strlcpy() to make sure the string is nul-terminated.
>
> Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org>
> ---
>  drivers/infiniband/core/cma_configfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>


Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-01-12 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12  7:56 [PATCH] IB/cma: use strlcpy() instead of strncpy() Xiongfeng Wang
2018-01-12 11:43 ` Leon Romanovsky [this message]
2018-01-15 23:04 ` Jason Gunthorpe

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=20180112114317.GL15760@mtr-leonro.local \
    --to=leon@kernel.org \
    --cc=arnd@arndb.de \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=wangxiongfeng2@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox