Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757094AbeAHPKR (ORCPT + 1 other); Mon, 8 Jan 2018 10:10:17 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:49410 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755386AbeAHPKQ (ORCPT ); Mon, 8 Jan 2018 10:10:16 -0500 Date: Mon, 8 Jan 2018 17:10:13 +0200 From: Sakari Ailus To: Xiongfeng Wang Cc: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de Subject: Re: [PATCH] media: media-device: use strlcpy() instead of strncpy() Message-ID: <20180108151013.ess23wiff7slpr7h@valkosipuli.retiisi.org.uk> References: <1515415259-195067-1-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515415259-195067-1-git-send-email-wangxiongfeng2@huawei.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 08, 2018 at 08:40:59PM +0800, Xiongfeng Wang wrote: > From: Xiongfeng Wang > > gcc-8 reports > > drivers/media/media-device.c: In function 'media_device_get_topology': > ./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 dest string is nul-terminated. > > Signed-off-by: Xiongfeng Wang Acked-by: Sakari Ailus -- Sakari Ailus e-mail: sakari.ailus@iki.fi