Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755086AbeAICzA (ORCPT + 1 other); Mon, 8 Jan 2018 21:55:00 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:52328 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbeAICy6 (ORCPT ); Mon, 8 Jan 2018 21:54:58 -0500 To: Xiongfeng Wang Cc: , , , , Subject: Re: [PATCH] scsi: mptfusion: use strlcpy() instead of strncpy() From: "Martin K. Petersen" Organization: Oracle Corporation References: <1515415753-10534-1-git-send-email-wangxiongfeng2@huawei.com> Date: Mon, 08 Jan 2018 21:54:43 -0500 In-Reply-To: <1515415753-10534-1-git-send-email-wangxiongfeng2@huawei.com> (Xiongfeng Wang's message of "Mon, 8 Jan 2018 20:49:13 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8768 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=803 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801090036 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Xiongfeng, > gcc-8 reports > > drivers/message/fusion/mptbase.c: In function 'mpt_display_event_info': > ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified > bound 100 equals destination size [-Wstringop-truncation] > > We need to use strlcpy() to make sure the dest string is > nul-terminated. Applied to 4.16/scsi-queue. Thanks! -- Martin K. Petersen Oracle Linux Engineering