Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626836

Re: [PATCH] [media] rainshadow-cec: use strlcat instead of strncat

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] [media] rainshadow-cec: use strlcat instead of strncat
Date 2017-04-20 00:20 +0200
Message-ID <ty678-z3-5@gated-at.bofh.it> (permalink)
References <ty1qP-6bq-35@gated-at.bofh.it> <ty5b3-8qb-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] [media] rainshadow-cec: use strlcat instead of strncat Arnd Bergmann <arnd@arndb.de> - 2017-04-19 19:20 +0200
  Re: [PATCH] [media] rainshadow-cec: use strlcat instead of strncat Hans Verkuil <hverkuil@xs4all.nl> - 2017-04-19 23:20 +0200
    Re: [PATCH] [media] rainshadow-cec: use strlcat instead of strncat Arnd Bergmann <arnd@arndb.de> - 2017-04-20 00:20 +0200

csiph-web