Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1517758ybb; Sat, 11 Apr 2020 05:28:30 -0700 (PDT) X-Google-Smtp-Source: APiQypJ+kNijHcyWaz0x9FKr1QSUiyu9H4gdlCj989CnRhaxtS7lQsWlEHz8hnufXx5FNzPEq64/ X-Received: by 2002:ac8:72cd:: with SMTP id o13mr3310191qtp.326.1586608110421; Sat, 11 Apr 2020 05:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586608110; cv=none; d=google.com; s=arc-20160816; b=uOXgEEJjgud/mOya9JyVWG9cDzNgAq2k5BjrULOWTA78Hv5M+zTAjf5AKa4qwrY2I4 T2Rq+1bj3pnuxW30ZfdHupKzJdfIuGarXA44Kt0NkE6AOqguZMXRSjg8TwPXzw0pzH1B LBCMtR3ihSzc7KmVbpXlysJM2eDhidndsYQ1jbXV9b4Hcr8sXRXobnJg4han470M+7nq obUZQ9NNds4OBtXqU2vh9g367pCa+kd/otSzaoC1FMAjv9Qa5EiurE+91O2NW6bf9O9M yfKR4KC7QrWQWEQXt9Hm/sYafW+aml/ZryHoAjwlVQr72LUnSqL3eqevwYTZCPSc72kT woaw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Vm4MaIAr9uTWAT/Fn/YzVsLCotcf/0FV9fAtPz7+g2k=; b=ThaRcR0Z6TMpv28od38XmJh0G2UvxpAUVSar+yjBwF/XMSMZDJpM88zhttqBWPz/I0 /xCH4dmF1XmbM7hCFQG5VDXlgL82a/EemDkYBR2fUfv7FoAS+aPgnXYl3SAjZF1qUPWs s9pAxxhQbTZOyCaESDbubUcHtw2XrBuXqqTeccAS+J6HZ+L4QK1W5pLMfuEFZVf1uNTX dUT/ATCgipOAACbs3H4NztuhXuqh5td9PuaR7DAUkanBEkPuG4M6fR8IpLHwJdBwm7zR 8aZrOrj8SsLpHAmmkmtO0udbWOeKIWvhy6Q4kNftz319hHgbr9LQoZdWR1xcNRdBVOuR 5Shg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WKDowyYA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si2946697qkh.166.2020.04.11.05.28.16; Sat, 11 Apr 2020 05:28:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WKDowyYA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728032AbgDKMOt (ORCPT + 99 others); Sat, 11 Apr 2020 08:14:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:48170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbgDKMOl (ORCPT ); Sat, 11 Apr 2020 08:14:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1742220692; Sat, 11 Apr 2020 12:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586607281; bh=wE60NzE6a4XNodsKvRma5brB+q02opg97ymdIJvL9Rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WKDowyYA0cAwZ2pbXeZMCLe5WhDmyPdoTFoIKOk7IHHkrQ60zKCr2uH6kRbn3JEha 3hDY49Awh1aD++Svd9zTRRrgFUWrjTH8NGlpPC+koF7Yk27GCcQQ4SUO/zcuOLRTH+ QOZiUT3UQjQygmIdveRJjZrMYn/MbJwfb8XEjs5M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Len Brown , Sasha Levin Subject: [PATCH 4.19 10/54] tools/power turbostat: Fix gcc build warnings Date: Sat, 11 Apr 2020 14:08:52 +0200 Message-Id: <20200411115509.251668935@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200411115508.284500414@linuxfoundation.org> References: <20200411115508.284500414@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Len Brown [ Upstream commit d8d005ba6afa502ca37ced5782f672c4d2fc1515 ] Warning: ‘__builtin_strncpy’ specified bound 20 equals destination size [-Wstringop-truncation] reduce param to strncpy, to guarantee that a null byte is always copied into destination buffer. Signed-off-by: Len Brown Signed-off-by: Sasha Levin --- tools/power/x86/turbostat/turbostat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 02d123871ef95..fb665fdc722a4 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -5144,9 +5144,9 @@ int add_counter(unsigned int msr_num, char *path, char *name, } msrp->msr_num = msr_num; - strncpy(msrp->name, name, NAME_BYTES); + strncpy(msrp->name, name, NAME_BYTES - 1); if (path) - strncpy(msrp->path, path, PATH_BYTES); + strncpy(msrp->path, path, PATH_BYTES - 1); msrp->width = width; msrp->type = type; msrp->format = format; -- 2.20.1