diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-04-19 19:15:32 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-05-18 12:24:46 +0200 |
commit | 5c621744b4270976f2dba71c49d92883afaf1604 (patch) | |
tree | f71838bc06c05e6dcfe234160b4f7f6d3149bc84 /drivers/media/usb | |
parent | [media] ir-lirc-codec: let lirc_dev handle the lirc_buffer (diff) | |
download | linux-5c621744b4270976f2dba71c49d92883afaf1604.tar.xz linux-5c621744b4270976f2dba71c49d92883afaf1604.zip |
[media] rainshadow-cec: use strlcat instead of strncat
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.
Fixes: 0f314f6c2e77 ("[media] rainshadow-cec: new RainShadow Tech HDMI CEC driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/rainshadow-cec/rainshadow-cec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c index 541ca543f71f..dc1f64f904cd 100644 --- a/drivers/media/usb/rainshadow-cec/rainshadow-cec.c +++ b/drivers/media/usb/rainshadow-cec/rainshadow-cec.c @@ -296,7 +296,7 @@ static int rain_cec_adap_transmit(struct cec_adapter *adap, u8 attempts, cec_msg_destination(msg), msg->msg[1]); for (i = 2; i < msg->len; i++) { snprintf(hex, sizeof(hex), "%02x", msg->msg[i]); - strncat(cmd, hex, sizeof(cmd)); + strlcat(cmd, hex, sizeof(cmd)); } } mutex_lock(&rain->write_lock); |