Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4200737rwl; Wed, 28 Dec 2022 00:21:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXv/aZg3XxOyjE5QHaA4uiyRiSCWzuHAbwpxtR2svuF+HedRS3WqhomeMEw1jR9w4AikSjSa X-Received: by 2002:a05:6402:e0f:b0:468:58d4:a0f2 with SMTP id h15-20020a0564020e0f00b0046858d4a0f2mr22925833edh.23.1672215687412; Wed, 28 Dec 2022 00:21:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672215687; cv=none; d=google.com; s=arc-20160816; b=m4hTJnBgPzmoIUX2ukM08uulFWSxWjVJ8ON6v4yrVPPbz1UAoZf2VgIJPsAQPhI7Cv KYDvIM7Ogd3y5x7JUcke7HzjBzh3eUxlU4EqOOi8GT0m6fy+l/8T/blRYkAkuFrMl0rl dmdjoaZmFF4Qo7DcotBDdn1elHyPfJdCTiLHG+hCRooGADJzqiba8E1nov0aI3KIZL6D 0pq3vnMHbbS/XzrMC70aeg+D6LrBDCQ9vDX2lrPlaveRm8J6UQiIIT+86hFOB7dvTjKa PRtUWQWn8kYY2R0k3oOb+OTBpm+LccVuko3kRy/85Uf5/HSKzCkUvE05G6uMUGltXzNG 3oow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=OiZk3iw/SIn6plklnnZRSCcuL+zy5kYf/S1ztyE+im0=; b=mnlj9C53+jSucnEvxHw43cGf/cZ3v4mscG5SJ7v4t3KOyqbO329b1knikpc/Cwu0kC lphKlbMa8+oBD1GTgEB2ZeC69hnz8eClf7xkowzEugy90h/P8AkSDdYFn25/dgDcXxGT 1fmW8kgw86okTXWpzywMuoO2BYw5gf4l/wSerb9Mq5/YiMKMTYER1uSS6/EzB9gsL7K3 oLE7k3WtPg0y2CCPedjciRe+wn4Djc/FldLxX5+boSHq8d+exteBpBQpkNVV1YdF5TWG f86daVVq8QEVJkxBQBkGsFg19Y/VVSPHI2/ZXOktdHqjyHsphQG4VenRAHtmrrkPYZr+ m7zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b="HAID7YT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m10-20020a056402430a00b0046ca78c5bffsi14523530edc.449.2022.12.28.00.21.12; Wed, 28 Dec 2022 00:21:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b="HAID7YT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232182AbiL1H6d (ORCPT + 66 others); Wed, 28 Dec 2022 02:58:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbiL1H6b (ORCPT ); Wed, 28 Dec 2022 02:58:31 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B75BEA0; Tue, 27 Dec 2022 23:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1672214290; bh=cXJ87oJBwBaxFCFIb6cYyvIrq6iLUXOa4/DOQ+Am96A=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=HAID7YT/vNUrVzsXDM4XmHQ6JmeC9tdByp0B27sHicNFTVdMkh8zu75WMZSQldfR5 dB2TFhqzCf79QB3dd0mLJAMej+QTcKhd74lxDQtpPmHcVue58cB7O2lxmyWKOVgdA2 OAEl1i2h08BMpGGovfROJYmnBC6E3JmBOERp2u5512tv+ife6GkjYAbJ370KgYbF1f /SFrBW4OCe35V6D3AW+ib4LdC3sEpSLvA+b7Q3ZHNNZJf7CKVv1+8YWj9d04T9dkWJ 2p5ZZQ7At665pHPl0UMQ3ho9i8MC1/EfkJzVbBENdcSROaBp9+jC3s5nIZKi2TPY4y RSaaDDBb75YXQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.60] ([92.116.184.137]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N2Dx8-1oi9c41F78-013b6v; Wed, 28 Dec 2022 08:58:10 +0100 Message-ID: Date: Wed, 28 Dec 2022 08:58:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH linux-next] fbdev: use strscpy() to instead of strncpy() Content-Language: en-US To: yang.yang29@zte.com.cn Cc: javierm@redhat.com, tzimmermann@suse.de, christophe.leroy@csgroup.eu, wsa+renesas@sang-engineering.com, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, xu.panda@zte.com.cn References: <202212280944112670081@zte.com.cn> From: Helge Deller In-Reply-To: <202212280944112670081@zte.com.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:AAhu+1ssDZWoHC1JNYuG/2KCh1p3zsD72YAqTRmf05EsUPmyzrO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LyV0ppFz4UEmSTdaWuyAqdX9hBqIL9V 6GVaThopKQkwi38AaEFCimKc3v20Ln0/ahu3XkZ4365ma4c3uoc4f2LEyPjpnxQ2WPmpVryLg NxLfhHirTVxZnqbzwD3Pf4j8RWI= X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/28/22 02:44, yang.yang29@zte.com.cn wrote: > From: Xu Panda > > The implementation of strscpy() is more robust and safer. > That's now the recommended way to copy NUL-terminated strings. > > Signed-off-by: Xu Panda > Signed-off-by: Yang Yang > --- > drivers/video/fbdev/aty/atyfb_base.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) applied. Thanks! Helge > > diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/= aty/atyfb_base.c > index 0ccf5d401ecb..851c1236fddb 100644 > --- a/drivers/video/fbdev/aty/atyfb_base.c > +++ b/drivers/video/fbdev/aty/atyfb_base.c > @@ -3192,8 +3192,7 @@ static void aty_init_lcd(struct atyfb_par *par, u3= 2 bios_base) > * which we print to the screen. > */ > id =3D *(u8 *)par->lcd_table; > - strncpy(model, (char *)par->lcd_table+1, 24); > - model[23] =3D 0; > + strscpy(model, (char *)par->lcd_table+1, 24); > > width =3D par->lcd_width =3D *(u16 *)(par->lcd_table+25); > height =3D par->lcd_height =3D *(u16 *)(par->lcd_table+27);