From: Ai Chao <aichao@kylinos.cn>
To: deller@gmx.de, nicolas.ferre@microchip.com,
alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev,
linux@armlinux.org.uk, dilinger@queued.net, adaplas@gmail.com,
James.Bottomley@HansenPartnership.com, FlorianSchandinat@gmx.de,
alchark@gmail.com, krzk@kernel.org, kees@kernel.org,
rene@exactco.de, tzimmermann@suse.de, rongqianfeng@vivo.com,
thorsten.blum@linux.dev, chelsyratnawat2001@gmail.com,
soci@c64.rulez.org, gregkh@linuxfoundation.org, daniel@thingy.jp,
linmq006@gmail.com, fourier.thomas@gmail.com
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-geode@lists.infradead.org, linux-parisc@vger.kernel.org
Subject: Re: Re: [PATCH 03/35] fbdev: sisfb: Use safer strscpy() instead of strcpy()
Date: Mon, 27 Apr 2026 18:14:17 +0800 [thread overview]
Message-ID: <20260427101417.2199601-1-aichao@kylinos.cn> (raw)
Hello Helge
...
>>> So leaving it as strcpy() is fine - and possibly even better.
>>> The header files might get changed to error strcpy() unless the compiler
>>> knows the source string has a constant length and the destination is
>>> big enough - but that hasn't been done yet.
>>
>> struct sis_video_info {
>> char myid[40];
>> }
>> I have rewritten the code:
>> strcpy(ivideo->myid, "SiS 730-0123456789abcdefghijklmnopqrstuvwxyz0123456789");
>> Used gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.3)
>> There was no compiler warning or error.
>
>Sure it would
>But the compiler issued a warning that the string is too big..
>So, such places will be detected at compile time.
gcc-version: gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04.3)
aichao@thinksys:~/dev/linux-next$ make W=2 drivers/video/fbdev/sis/sis_main.o
CC [M] drivers/video/fbdev/sis/sis_main.o
There was no error and no warning.
Thanks,
Ai Chao
next reply other threads:[~2026-04-27 10:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 10:14 Ai Chao [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-04-27 9:09 Re: [PATCH 03/35] fbdev: sisfb: Use safer strscpy() instead of strcpy() Ai Chao
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=20260427101417.2199601-1-aichao@kylinos.cn \
--to=aichao@kylinos.cn \
--cc=FlorianSchandinat@gmx.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=adaplas@gmail.com \
--cc=alchark@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=chelsyratnawat2001@gmail.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=daniel@thingy.jp \
--cc=deller@gmx.de \
--cc=dilinger@queued.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=fourier.thomas@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kees@kernel.org \
--cc=krzk@kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-geode@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nicolas.ferre@microchip.com \
--cc=rene@exactco.de \
--cc=rongqianfeng@vivo.com \
--cc=soci@c64.rulez.org \
--cc=thorsten.blum@linux.dev \
--cc=tzimmermann@suse.de \
/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