Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3987830imm; Tue, 29 May 2018 18:56:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxnU6fBnf384nMnAQJNgrP4ueA9UAJbYMqsUAdA7tmcIHjkvQ6UXTeZ9O2rUvyuz1YX9nX X-Received: by 2002:a63:bd49:: with SMTP id d9-v6mr673904pgp.14.1527645365398; Tue, 29 May 2018 18:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527645365; cv=none; d=google.com; s=arc-20160816; b=KyijtQaMsQ/oWuSZ4lQMVdjWGNLpi5UgRiCBEtuuIbQWL3YawwTVcm/smy54N0DxHe k4HFmQ3b/TLK7SCkSiosrFUV4OhQJMq7VZQ3kwk8nkl1QwHdFRjOa+6d9Xp3vuj9MqiA KNY4ouIAz00+hljJR7OHRBf/aRzEMzdXiL2qUqtgX8bX4NV0BqtVaMY1Sv0/8gtTbO3B 2YTXT7+tqRB6sW0eQ8278gsLDOXuUIWhjVijpWqMa63IGz76hKzDE4bUAx0w0tqXc9X6 PTVjHxrkeprzSo1msC4+nXaWmV2wCKD8orDXlr+cIqc4eYkzzre3klDHToCaADLqlS3C ozTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=M9RH66AczBcFV8E4ffgz2Wz1s6CyPVNuPqAzN41QyI0=; b=DA5sCgeTElmfqSTGIpk9sWw1PWvZqewcIZJb9vebwOlDZ2PycYxSB/N6rkwHPEr0fT LkcWPl7s/GTkRUGIiT/pYj17OxAirQCviJaDNFiClLUw9Udyf6sOsfsNHCMSGtbzTyRA A2nnuvUIAPWh0h9e3MvO5wA5Y+OOVlg7+Doh5S2P2K+M9QHKjdf3bb1pmHHhRMLihvEv dufQgb+RC6TV7cfXIb11nHSp7FtoTkvrDcD4KnC7Jz8AMYl5QTxQXX8trOceLdYkZJ68 LhvQGcwr+C9WQbRCBTxjxd8wvsYAo2bXfMm/hWRM28JyXfADUc+rMS3zdtwqfT1VfkXB BLHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IXbw5CR6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v137-v6si632400pgb.682.2018.05.29.18.55.51; Tue, 29 May 2018 18:56:05 -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=@gmail.com header.s=20161025 header.b=IXbw5CR6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968583AbeE3Bz0 (ORCPT + 99 others); Tue, 29 May 2018 21:55:26 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:42629 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968489AbeE3BzY (ORCPT ); Tue, 29 May 2018 21:55:24 -0400 Received: by mail-ot0-f194.google.com with SMTP id l13-v6so19320564otk.9 for ; Tue, 29 May 2018 18:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=M9RH66AczBcFV8E4ffgz2Wz1s6CyPVNuPqAzN41QyI0=; b=IXbw5CR6P90z9bVdaW1+7t8rEJFowVr2aqsGh+yXc1TZl6SCOcEuoJudMOyAGGUZkW pu0Tz1I0+AfvqNXEeQRornPfPvLuAvo2St+oL+lksZ8gPgwMLN3w0tv9vU0DQeTfvhKC JGInoDdvijbEWHfzJgm++23y95LsYi27XAEYhPD9+QDPiCXZqbZoN1uBFJcnbAvketrR ALNRnrFKaO9OGiYeOGvImsItDvhlJPGP/jF2ygNJGPa9D7bg2dG94UDilsTMcxzTSXPW oQx6Lz2IFFXN/aTlh9HzaM7GzMMSwGpRpDcEjkhp1ZZ+sFNO/EagaZ56o361BtI9k/yB sZ9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=M9RH66AczBcFV8E4ffgz2Wz1s6CyPVNuPqAzN41QyI0=; b=J/5CjF81NvaqZiQWkRUq3lqCk2/cCMoqKYC+ny7l9fCf+Yl30M+8SVlOcICBe7hSYD i+ZHsdKjWLfDERh55ZeZ+taG/sT71HWhDF4sZy6yGmJGSqYa1Kpug2g6dYI64uWXEJ4o 6IrpU2fRNb/Y+9mvvgyNr4j43Hr/Qv4fYPOZQCN1Khq2BX7PdF1qL2TkTosqe90EtC+H K6ZJVTwu4K60bjoZu3w33/BchDicWIqkQzmOxltAmbxNUg/QbLDwRicoZayydJ+Zv/Lz 05zvZy/mL0VDA8lcbqoXebckjrECQL0DTAdB2mpFvu+GKfg3yLFVES7s/V84PZSeto7s q11Q== X-Gm-Message-State: APt69E0HBK7ZzMeizf7F1RZ0R+ae3sJYgvI4aHeA5r7WYOgliPbfEiqo HYA8cqIecc8qCDZ7rC4rwJbYTAMZk/c6hjkX+cM= X-Received: by 2002:a9d:5b2a:: with SMTP id x39-v6mr467765oth.243.1527645323878; Tue, 29 May 2018 18:55:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:2451:0:0:0:0:0 with HTTP; Tue, 29 May 2018 18:55:23 -0700 (PDT) In-Reply-To: <1527573818-29712-1-git-send-email-nick.desaulniers@gmail.com> References: <1527573818-29712-1-git-send-email-nick.desaulniers@gmail.com> From: Nick Desaulniers Date: Tue, 29 May 2018 18:55:23 -0700 Message-ID: Subject: Re: [PATCH] tracing: prefer strlcpy to strncpy To: "Steven Rostedt (VMware)" , Ingo Molnar Cc: Nick Desaulniers , Linux Kernel Mailing List , ebiggers@google.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.