Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3905280imm; Mon, 4 Jun 2018 11:11:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIWCz7+LOZntpzcUnFM5NrdqIPhpXG1I3o2oARgGeRW1hdGXNIcXV8KxjQ6HvbCqIxbicrX X-Received: by 2002:a17:902:7686:: with SMTP id m6-v6mr23029371pll.340.1528135905985; Mon, 04 Jun 2018 11:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528135905; cv=none; d=google.com; s=arc-20160816; b=YX9hOyu9Ds3XC/+TzQ8g0qhh+VSx9t2sKn8rCT92SrF+dgH8HsUEOPeS/cLG7fMmZD 0GG/yY7KWq0wmXEfTyp51AhEPSu+KoKetV0W2zZYjK4pCrO7MrDVgYMM9YkLfOLAg3aA CcCO9o4XT6QkF4IISeoL9m1NkY21y98R6uIKtPx/2mrf0ycLJfDqsmp2uVvDFXDJq5M9 6HVE2v27Nk4ZGK60hl/n+5vWynID0cLIqBUzc6ANrQzD4BpqTfNXlaRnW6juJ9Y5zlXz H+4GBr62utycNasbluzzNy8eL9gAi2gV/b4jC/q1oiHA6HJn7uKA+ftWBJUUhBaoWlul PR5w== 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:subject:cc:to:from:date :arc-authentication-results; bh=/hWfH5k95P5JRxINQeX0NubPiOnAREyiBlmo3yElhuI=; b=ivPUlniX0LE8kr2t1I2Xs7qB9axRO0oLso+a/gZBTF17/+fJkHrW33hYd5HjTmCc+i 0DAHGfpnk1P2YOuf0YXmiUq8UtvIJ/Y8VlPQB94S/TD886+yE1P8wY6u77TGAa+ymLw0 5UoQ5AGyFui7nSGyVPqCUVSRYH6YAyZKU6u4B9ez8gqzgX1jdZyRPPUkgb8BBU4ywRFf P8ZTe/pqq6mkduuG5dx2lFnaIRvfeeuD10zwI1IDBFTw9A2/7VQMS1rbrLdaYz/PisYu 7ALs4aQYS6iifes9/9Wwg8/hwqkOZcXe/UIm/Q/5s7ctWVmikR4P7vk2AXBtYpI9ITvr qfiw== ARC-Authentication-Results: i=1; mx.google.com; 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 v10-v6si5496987pgo.643.2018.06.04.11.11.31; Mon, 04 Jun 2018 11:11:45 -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; 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 S1751303AbeFDSKG (ORCPT + 99 others); Mon, 4 Jun 2018 14:10:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:56464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750999AbeFDSKF (ORCPT ); Mon, 4 Jun 2018 14:10:05 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (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 1180F2088F; Mon, 4 Jun 2018 18:10:04 +0000 (UTC) Date: Mon, 4 Jun 2018 14:10:03 -0400 From: Steven Rostedt To: Nick Desaulniers Cc: Ingo Molnar , Linux Kernel Mailing List , ebiggers@google.com Subject: Re: [PATCH] tracing: prefer strlcpy to strncpy Message-ID: <20180604141003.3b3d507b@gandalf.local.home> In-Reply-To: References: <1527573818-29712-1-git-send-email-nick.desaulniers@gmail.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 May 2018 18:55:23 -0700 Nick Desaulniers wrote: > On Mon, May 28, 2018 at 11:03 PM, Nick Desaulniers > wrote: > > Fixes a stringop-truncation warning from gcc-8. > > > > Signed-off-by: Nick Desaulniers > > --- > > kernel/trace/trace_events_hist.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c > > index b9061ed..b53a6c0 100644 > > --- a/kernel/trace/trace_events_hist.c > > +++ b/kernel/trace/trace_events_hist.c > > @@ -393,7 +393,7 @@ static void hist_err_event(char *str, char *system, char *event, char *var) > > else if (system) > > snprintf(err, MAX_FILTER_STR_VAL, "%s.%s", system, event); > > else > > - strncpy(err, var, MAX_FILTER_STR_VAL); > > + strlcpy(err, var, MAX_FILTER_STR_VAL); > > > > hist_err(str, err); > > } > > -- > > 2.7.4 > > > > Eric points out this wont initialize the rest of err with zeros. And why do we care? -- Steve