From patchwork Mon Aug 5 10:26:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 11076517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8629C13A4 for ; Mon, 5 Aug 2019 10:26:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7120E2882C for ; Mon, 5 Aug 2019 10:26:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62FAA2887E; Mon, 5 Aug 2019 10:26:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19C5C2882C for ; Mon, 5 Aug 2019 10:26:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728086AbfHEK0y (ORCPT ); Mon, 5 Aug 2019 06:26:54 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:35823 "EHLO mail-pl1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728043AbfHEK0y (ORCPT ); Mon, 5 Aug 2019 06:26:54 -0400 Received: by mail-pl1-f176.google.com with SMTP id w24so36301068plp.2 for ; Mon, 05 Aug 2019 03:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PaEof87/l2CSH7k/oYAMcB821mdfap6W4g9T3RgxBNg=; b=I3whiINGB42OpMPQxOqv1YyMou3cUUYTIeanNf2TP5sU5aKKX4uQNfSV1ZrSWA/a0Z 1E9IeH9UIEX+E2ooK7PoKQ07ok+8/tHoTmw2k+O6lrtG5n/l9qZ7o4pQcF0J/bfwax1o oZaZG+PGSTI97AZ9PR4n1hBgbpfKHdshmbUwn9tqqASvJ0coBI3isxWA5UqbKJsH3C+j +mTLi3zU0jg1cDlZYctncmf9mlptJ5f2b0C4cJZ/Hho2aZGRyOB3PHHuL+Ldiv+VhjAg W8rhMyIskez+RAqpkVVQTKRGFV6O5PHMzoOGrAjEkxiPlv3yM8GJHKw4N7V/od8wgiPn 4ksQ== 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:mime-version :content-transfer-encoding; bh=PaEof87/l2CSH7k/oYAMcB821mdfap6W4g9T3RgxBNg=; b=FlcwqQV+QRga/9G7e5rdFr6bLZSQxd6CwepcvzuBuOx0uhjeIF8rMij/KyGuk1zH7i NiYyn3f5k3HJ0JJhpBYjPcq+9q5dvyXyoYJ6QTIQ/hMHFVWs4ZlI/UIi+0AkviSQKOni gsK0ajtYQQ3SwPqTVW1Kx0UW6mLLolq2Em0W+n7fOELoVrkiLXY4XnUZ+TTHb6C83NeE sCRdS6bKz3ieQjWVrtSO1HGwsR7LhLAdCBz+5sCsB8JjD8bVtND8UW6wULQa5YvXs/+d ovQ7ZmPaIh2ZdgLwuQaljJbNaST7xlBmsV+HNXpTybQzOlFunBiFxvaL7Mnbt+wAKasm x/yA== X-Gm-Message-State: APjAAAW14YoIXLMPjtwMzPkBxRsk7zU4eifpNaFMcJqak+oemmU0M6A4 +/+zmNRr9pNIbZJQl789TCY= X-Google-Smtp-Source: APXvYqzQLcw9Gzn9RGbG9HjAXXQyNPCvr9/vQaLP/TK+qvcbc+VHj9aSXxKW8xzBRJy9Y4o7LuDnyw== X-Received: by 2002:a17:902:4623:: with SMTP id o32mr141251701pld.112.1565000813873; Mon, 05 Aug 2019 03:26:53 -0700 (PDT) Received: from localhost.localdomain ([110.70.27.66]) by smtp.gmail.com with ESMTPSA id x13sm88613482pfn.6.2019.08.05.03.26.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 03:26:53 -0700 (PDT) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky To: Steven Rostedt Cc: linux-trace-devel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCH 1/2] parse-events: deref pointer for proper sizeof() Date: Mon, 5 Aug 2019 19:26:45 +0900 Message-Id: <20190805102646.31142-1-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Sergey Senozhatsky --- parse-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse-events.c b/parse-events.c index 3d59d92..807fc53 100644 --- a/parse-events.c +++ b/parse-events.c @@ -2058,7 +2058,7 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char ** goto out_free; field = malloc_or_die(sizeof(*field)); - memset(field, 0, sizeof(field)); + memset(field, 0, sizeof(*field)); value = arg_eval(arg); field->value = strdup(value); From patchwork Mon Aug 5 10:26:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 11076519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0943213A4 for ; Mon, 5 Aug 2019 10:26:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA78E286E4 for ; Mon, 5 Aug 2019 10:26:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE7462887D; Mon, 5 Aug 2019 10:26:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9979D286E4 for ; Mon, 5 Aug 2019 10:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728281AbfHEK06 (ORCPT ); Mon, 5 Aug 2019 06:26:58 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:41413 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728043AbfHEK06 (ORCPT ); Mon, 5 Aug 2019 06:26:58 -0400 Received: by mail-pl1-f193.google.com with SMTP id m9so36169370pls.8 for ; Mon, 05 Aug 2019 03:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H5a0d+8RpwXiSrY19a0aDW2ItSnarcmNf3hA69Qx9ww=; b=daNeQjnRcGeZ1qPO4aOWJvxI9AY/oC+mLojtAmibj/rS2YZ3VVYTvbLn6E2fryuYtt WWtVlQbDmGUP8qDcuWKDwnYfBiV3A3fxSXTGmy7IcA5INWJ4jGdza2rIOG1ZmbDqakqt sGBN8fQmy3OhLNZUQ0QIRRe+ri+1BK+vkRHZa8Y3x/qvBpyAQxsyOpzmn9JnOb44Llgl LjlZ0UA88bom0GL2/84eZtjkQLtUvvVINVkm2FcLuw3teAAAY0/6+mbr+Hl70HxUIZOl zu36z4JzzccSLrtucFHR+AMhy8xYlrJeE9eX5dXZSQ/nbHfG5a2mxif1IUnioUoAUieP 1Exw== 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=H5a0d+8RpwXiSrY19a0aDW2ItSnarcmNf3hA69Qx9ww=; b=V8D26kSVhwazvYzMHYJFUZ4p4AcS24nfYqRNtYNYNqthW6tRqlNB0jRqjgZrxOZXg5 W2iRpreDNeGO7T+QKFB8sem/tFldJG6a+FtR6NXNRuuvmy/PYs2y5Gt0nwOwhkkutjrh 6dKd71GYLdJHYMKfitbIOdmOL5RALnb+pvqWp4lLu5gZ0iFBn2tUF7GcU5KgMNEWBO1i SICYFdWnIqtALK7McMYYjmWVNuVyX4vNB/TYF/L/aR6ii2lS8Ae8gRJB5U2j9WenqBNY rj7S+yLGFDb69m1NaLFplM/yv04fuJJGwCGTckr82KFSPlrGLAW9jJax2hdmSCWGqYcS W2FQ== X-Gm-Message-State: APjAAAVyEhaFjzf+9ipvBcO70nYEOfTWfK+n/DCe00R/W4hlHBhsDiwc 52pOJqQPc2S1EywFxfezZm05KNXN X-Google-Smtp-Source: APXvYqx21GAGvTihssK+PNExL7JJJbZN9JnFZvQCvKUmqwjSJjho0dwYaLfYtmnxA5oKU76MUC1Lqw== X-Received: by 2002:a17:902:4324:: with SMTP id i33mr4860909pld.108.1565000817739; Mon, 05 Aug 2019 03:26:57 -0700 (PDT) Received: from localhost.localdomain ([110.70.27.66]) by smtp.gmail.com with ESMTPSA id x13sm88613482pfn.6.2019.08.05.03.26.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 03:26:57 -0700 (PDT) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky To: Steven Rostedt Cc: linux-trace-devel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCH 2/2] parse-events: deref pointer for proper sizeof() Date: Mon, 5 Aug 2019 19:26:46 +0900 Message-Id: <20190805102646.31142-2-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805102646.31142-1-sergey.senozhatsky@gmail.com> References: <20190805102646.31142-1-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Sergey Senozhatsky --- parse-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse-events.c b/parse-events.c index 807fc53..1a25a7d 100644 --- a/parse-events.c +++ b/parse-events.c @@ -4778,7 +4778,7 @@ int pevent_register_event_handler(struct pevent *pevent, not_found: /* Save for later use. */ handle = malloc_or_die(sizeof(*handle)); - memset(handle, 0, sizeof(handle)); + memset(handle, 0, sizeof(*handle)); handle->id = id; if (event_name) handle->event_name = strdup(event_name);