Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3550280ybz; Mon, 20 Apr 2020 05:08:43 -0700 (PDT) X-Google-Smtp-Source: APiQypKI5sR+hD/DYBs0I7CbHjzSOOFiEs4bgPDN3JPET5DQIXrkGRMoUXX9akgak8Nw3sAuELcJ X-Received: by 2002:a05:6402:22ba:: with SMTP id cx26mr10530561edb.198.1587384523086; Mon, 20 Apr 2020 05:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587384523; cv=none; d=google.com; s=arc-20160816; b=LJL3rTPeUsr8F1y14ymF2glZgNWPSZsFVk8k4yU3rVq9RHW6S+WlFKVsuS1+qEFvjH h+wH4h/6xwOb7WQgRRqV9QNcXuPjLbM/U9SJgz/Tl4RP3GmQyqguqUHP46pao3iRVhWY o26dE6aTsxt53e+mHXpntUbfkyMGoBx9kaN7PXI79EGTVSJ4YAgH9JxGOPIQA1O7874M YytqoHrI69QxErJ1pzezirOi5z4Zx+qR/aL4JBzXmgHtvKCZdlcvOlsbLSI/dco9XqkM SoXxunUMncCWTrEytFfJFH7QMknxtFSNrQeXO/RWHtcRNqD99xwUr5zxnDlRLpdztOXn suFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RGG4/yjvuMH3FlIn0X+Fl1fHjCz3q6wAoOFCkN6ckTE=; b=BE7pQrfj1P0f6uOebBRpdRlzzX1u1cO7w1/OjkFcKx2ReBYNwzjqpKM8Dg6dBpCu5t yHIIF0HGvX3OCbgRg2X1l7PUP7GOTP9oMfXiYmUaD67xa93f/K2pVZNX9F+0nJSUjhP3 eQ41HtcZhjjf6tkEsXVYcHY2QDep+6WC/Ll+sxK7q/YZLglrYBDx43SAm72jWTEvDYrc CbJsVxuaFjxKzBW/zcntD3Ye8W1iej8oAHz7i1qOBNfM8Rkia3RbN6O0ZfXyjgtcbZq5 ajQSB0dAUj4DRct7Q6t6D7ZuZBT/kFzxWtTlx9UCdchWmhl4zB/1WmhfIAQc4qt7ZG8B /W6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=Cpx7MQs8; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si464791ejc.293.2020.04.20.05.08.10; Mon, 20 Apr 2020 05:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@codecoup-pl.20150623.gappssmtp.com header.s=20150623 header.b=Cpx7MQs8; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbgDTMHP (ORCPT + 99 others); Mon, 20 Apr 2020 08:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725944AbgDTMHP (ORCPT ); Mon, 20 Apr 2020 08:07:15 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9436C061A0C for ; Mon, 20 Apr 2020 05:07:14 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id n6so6250311ljg.12 for ; Mon, 20 Apr 2020 05:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RGG4/yjvuMH3FlIn0X+Fl1fHjCz3q6wAoOFCkN6ckTE=; b=Cpx7MQs8uUNpqY3C/kpzCDmBRbkFa69ZJgq+nZ/aZ1uxKI3evF8n1TRIKO3+MId/mk V60HgCXJ5BCGxCyVeisHwR3QJu+S3FZxA5DqyAQEaPIqk79IKep0uBbh4iyvwPg9/4eL JAvj8rZ9zVP4i76Uv3mlIXcZHiqXyBexFK4fa90apmZ9DaCgxDLI/BzKGXQbCsFRM6Ek qkP8CWeotd+kObIypEzZORyUshfQsJQtTo0yGmULdItVDio8d9vE48eBayk52+YKmTxs 1IbEDMteX+TriN8Avm7U2As/MAzNV3TFS7Sr8n8MaFe/1fW0QvB5D6vOxpS1LdafIIjH fDEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RGG4/yjvuMH3FlIn0X+Fl1fHjCz3q6wAoOFCkN6ckTE=; b=Baxr88ysp2+bwHRzIFPXXW4JrQSA5TNVIe+C6xxceKGrRxTlWyXRg8EcsPTnGYYZ47 b5mE9P4m3KHSCRhFKXTleJOpBIPJ7QHGcNm/vgRiikFwX1jGCVb9B5/ba7NwAy39AzFG pM1qYyRck9PxFKxTyGdzO5gS1Z4S1Q/GZJIhZmIvoSsmpw2q9Yd7Cb6tJRlMw0VBbwOl G9UKrQ0oMYYMB1jOkiWSnmcpj1NehfT+2C/XhAYQfBhR5+JSCwCRnTeE0tD0DN+lf7UP qNKULAhEdmj4MaBX9eYzZjYP7qkCIkp3PocFMScTZvYs/oHBYF0b8fMGIruxiG8opral QwLA== X-Gm-Message-State: AGi0PuY/xkBaNzgM2W+HyPfv31KESpvOJhn1yD4j1pulTfPOkvN5ZZML zLCe9dlnva9eczdERpmGHGC9eWX97fs= X-Received: by 2002:a05:651c:390:: with SMTP id e16mr1664258ljp.186.1587384432835; Mon, 20 Apr 2020 05:07:12 -0700 (PDT) Received: from localhost.localdomain (45-11-60-42.ip4.greenlan.pl. [45.11.60.42]) by smtp.gmail.com with ESMTPSA id i18sm666814lfo.57.2020.04.20.05.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 05:07:12 -0700 (PDT) From: Szymon Janc To: linux-bluetooth@vger.kernel.org Cc: Szymon Janc Subject: [PATCH 3/4] avctp: Fix compilation with GCC 10 Date: Mon, 20 Apr 2020 14:07:04 +0200 Message-Id: <20200420120705.89691-3-szymon.janc@codecoup.pl> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200420120705.89691-1-szymon.janc@codecoup.pl> References: <20200420120705.89691-1-szymon.janc@codecoup.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This one is a false positive but since we never use more than UINPUT_MAX_NAME_SIZE bytes of name we can silence GCC by reducing size of source string. CC profiles/audio/bluetoothd-avctp.o In function ‘uinput_create’, inlined from ‘init_uinput’ at profiles/audio/avctp.c:1259:20: profiles/audio/avctp.c:1188:3: error: ‘strncpy’ output may be truncated copying 79 bytes from a string of length 248 [-Werror=stringop-truncation] 1188 | strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors --- profiles/audio/avctp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c index 37ffde9e7..058b44a8b 100644 --- a/profiles/audio/avctp.c +++ b/profiles/audio/avctp.c @@ -1246,7 +1246,7 @@ static int uinput_create(struct btd_device *device, const char *name, static void init_uinput(struct avctp *session) { - char name[248 + 1]; + char name[UINPUT_MAX_NAME_SIZE]; device_get_name(session->device, name, sizeof(name)); if (g_str_equal(name, "Nokia CK-20W")) { -- 2.26.0