From patchwork Wed Apr 19 17:15:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9688367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 135D36037F for ; Wed, 19 Apr 2017 17:16:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 023572815E for ; Wed, 19 Apr 2017 17:16:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB3842842E; Wed, 19 Apr 2017 17:16:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 887DD2582C for ; Wed, 19 Apr 2017 17:16:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966593AbdDSRQD (ORCPT ); Wed, 19 Apr 2017 13:16:03 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:62663 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966573AbdDSRQC (ORCPT ); Wed, 19 Apr 2017 13:16:02 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0M3rTW-1c9TMv2SYc-00rVDP; Wed, 19 Apr 2017 19:15:39 +0200 From: Arnd Bergmann To: Hans Verkuil , Mauro Carvalho Chehab Cc: Arnd Bergmann , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [media] rainshadow-cec: use strlcat instead of strncat Date: Wed, 19 Apr 2017 19:15:32 +0200 Message-Id: <20170419171543.3274995-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:mlKWXYldWm8fNw3DaP7eSuuuRwVXXH1Uz2rurHqxWLlZWtX7+Re rQUDEgIpQeMv1CD724AW7GZvEIJQF6zIeP9s2TB6aZOBSGyLANy4zFbWeWaVPkL52sbGaPo tV7K1t9Mpj8u79F23ia7CjZH5d4XVBAU3PUp4EmpFGCz1McSWOaQr4KpSGlqUDqoK8xE9A8 WvC12MbzLKktb7O58qDRA== X-UI-Out-Filterresults: notjunk:1; V01:K0:oiZVx9lD7io=:wIpnijKb6tD/sgj9fKJppv VhMUD/4GgQKwsXKT7ZE3A2dY9dBkjDVKXH97B2MjrwZT2R0h4Not4IEDOn4mNiAnLUN5tkqjZ Tc9YFbkdOLjXXH043jqbOVZg1SJJKcNpWclal5pfsutLPj+kK76gJceZuHD36hu7pdgF3vk76 thKYTF89fEoLpIazwba9Oya8wehDNn6AtWtRG6idc3vfBPNJptsbrHF1uExm7HJslvM+linOC l1h0OPPxYktz6VF7KfEkGKFY9KUusv08ZrygZPsA0EUqOO/HGufaz0c2/8TVhFtTapw22A1aN UGpGpRnXcAkgTSa2mWfywCK8QQsnuCg9I41YXUeXBE4qEGssdEJgJ0TeXMKP0RwHi0G4uBKGX nYaVVL1j5kK77lqGNvHX2jV/uBZCXCoEdpMV5mr1oUsJdrT+rHRx8eF9tSd82gNNkfR0yDV7M hj02cuWqbvVeQFlONEnb3miuv+5X65OPoxf4Wf1iTfqBbXWpZGHIFnRuWHqJzkmtIzQ5seyhA uMvaPeyESxpyeHFBjIKYFvncKT4eH4XA9NYjIDi37K3d+D/nksH5VZiJRTij+B/HbTkFFWW4W bvmS88Aw53kH6O7Z0GgmKmjexYdBlLZWFMClyYjmIiBMzVQkLsfAdJ0dwA7gz3ZPlquF+woK0 3RWMhmXEO14KjLU9SRRNu1aQlTbT1zXSTfDzC76x3bdJTErwA/uIqalcFW4enhbRUTRY= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/media/usb/rainshadow-cec/rainshadow-cec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);