From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A3B5C388F7 for ; Tue, 3 Nov 2020 12:15:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEB4422384 for ; Tue, 3 Nov 2020 12:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604405740; bh=RqOUqhub1p7UVpsEDddWrEzjzkacwuz/1Ck8fq4kG8U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=hLaCnDobeCZzMqT4+ZPl0Fr83vF8hRyhHE6szouPyDp8BXw9lNrfVh1D7aLMcwrGB fgg9VF7ggGucMd5IsdZ/ClKvjNmdZtmwFibdXzoj8pDfdSkM2bvu5G1Tgd/pEErtIP qosG/z2dV6MI00gS1gMT+LjS2lwcnbGwd7t/I+Uc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729022AbgKCMPj (ORCPT ); Tue, 3 Nov 2020 07:15:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:37636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728966AbgKCMPi (ORCPT ); Tue, 3 Nov 2020 07:15:38 -0500 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (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 74DDB21D40; Tue, 3 Nov 2020 12:15:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604405737; bh=RqOUqhub1p7UVpsEDddWrEzjzkacwuz/1Ck8fq4kG8U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vicuSlojI8Bg8z2I5HttNlQi1rIWPPC7m3lxy75QLX6rbZlMLuszZJoyX8Z3HYJdI lN5n+8c9Jw7XveHgBjMJ2ohSwExEBibLH85wj5/sMRnkkiOqToV8FquxbkuL14FOa9 JrllGZ/EsDaCz4dLkKGCbbsoW9MZyhq4W36eSw8Q= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 5F98E40452; Tue, 3 Nov 2020 09:15:35 -0300 (-03) Date: Tue, 3 Nov 2020 09:15:35 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jiri Olsa , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian Subject: Re: [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Message-ID: <20201103121535.GD151027@kernel.org> References: <20201101233103.3537427-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Nov 02, 2020 at 10:50:00PM +0900, Namhyung Kim escreveu: > Hi Jiri, > > On Mon, Nov 2, 2020 at 8:31 AM Jiri Olsa wrote: > > > > We display garbage for undefined build_id objects, > > because we don't initialize the output buffer. > > > > Signed-off-by: Jiri Olsa > > Acked-by: Namhyung Kim Thanks, applied. - Arnaldo > Thanks > Namhyung > > > > --- > > tools/perf/util/build-id.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c > > index 8763772f1095..6b410c3d52dc 100644 > > --- a/tools/perf/util/build-id.c > > +++ b/tools/perf/util/build-id.c > > @@ -102,6 +102,8 @@ int build_id__sprintf(const struct build_id *build_id, char *bf) > > const u8 *raw = build_id->data; > > size_t i; > > > > + bf[0] = 0x0; > > + > > for (i = 0; i < build_id->size; ++i) { > > sprintf(bid, "%02x", *raw); > > ++raw; > > -- > > 2.26.2 > > -- - Arnaldo