From: Arnd Bergmann <arnd@arndb.de>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [media] rainshadow-cec: use strlcat instead of strncat
Date: Thu, 20 Apr 2017 00:15:30 +0200 [thread overview]
Message-ID: <CAK8P3a1utR98zYa2a_FVaCDZMR6MAySLFDPBj7i8FziCoQ+6xA@mail.gmail.com> (raw)
In-Reply-To: <e0cdbe4a-740d-70b4-6d98-5f72467a937b@xs4all.nl>
On Wed, Apr 19, 2017 at 11:14 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On 19/04/17 19:15, Arnd Bergmann wrote:
>> gcc warns about an obviously incorrect use of strncat():
>>
>> drivers/media/usb/rainshadow-cec/rainshadow-cec.c: In function 'rain_cec_adap_transmit':
>> drivers/media/usb/rainshadow-cec/rainshadow-cec.c:299:4: error: specified bound 48 equals the size of the destination [-Werror=stringop-overflow=]
>>
>> It seems that strlcat was intended here, and using that makes the
>> code correct.
>
> Oops! You're right, it should be strlcat.
>
> Which gcc version do you use? Mine (6.3.0) didn't give an error (or warning, for that matter).
I think the warning was only added in gcc-7.0.1.
Arnd
prev parent reply other threads:[~2017-04-19 22:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 17:15 [PATCH] [media] rainshadow-cec: use strlcat instead of strncat Arnd Bergmann
2017-04-19 21:14 ` Hans Verkuil
2017-04-19 22:15 ` Arnd Bergmann [this message]
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=CAK8P3a1utR98zYa2a_FVaCDZMR6MAySLFDPBj7i8FziCoQ+6xA@mail.gmail.com \
--to=arnd@arndb.de \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).