Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750933AbeAOXE5 (ORCPT + 1 other); Mon, 15 Jan 2018 18:04:57 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:45225 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbeAOXEz (ORCPT ); Mon, 15 Jan 2018 18:04:55 -0500 X-Google-Smtp-Source: ACJfBovXg9LXFUXv+xi5jZsuvgg6vjWPmagyyf9iygUqrz95evX5vsV76vx66s6intls1LIc8ZP5mw== Date: Mon, 15 Jan 2018 16:04:51 -0700 From: Jason Gunthorpe To: Xiongfeng Wang Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de Subject: Re: [PATCH] IB/cma: use strlcpy() instead of strncpy() Message-ID: <20180115230451.GA1867@ziepe.ca> References: <1515743765-116090-1-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515743765-116090-1-git-send-email-wangxiongfeng2@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, Jan 12, 2018 at 03:56:05PM +0800, Xiongfeng Wang wrote: > From: Xiongfeng Wang > > 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 > Reviewed-by: Leon Romanovsky > drivers/infiniband/core/cma_configfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied to rdma for-next, thanks Jason