From: Michael Sartain <mikesart@fastmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Michael Sartain <mikesart@fastmail.com>, linux-kernel@vger.kernel.org
Subject: [PATCH v3 6/6] Fix cases where string literals were passed as string format args
Date: Wed, 14 Jun 2017 18:28:01 -0600 [thread overview]
Message-ID: <c6a1d73387c9badf6b1e773d5fabb6a349838f46.1497486273.git.mikesart@fastmail.com> (raw)
In-Reply-To: <cover.1497486273.git.mikesart@fastmail.com>
In-Reply-To: <cover.1497486273.git.mikesart@fastmail.com>
Signed-off-by: Michael Sartain <mikesart@fastmail.com>
---
trace-capture.c | 12 ++++++------
trace-dialog.c | 4 ++--
trace-filter.c | 10 +++++-----
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/trace-capture.c b/trace-capture.c
index 1acfe44..4e1392e 100644
--- a/trace-capture.c
+++ b/trace-capture.c
@@ -1019,7 +1019,7 @@ static void save_events(struct trace_capture *cap,
tracecmd_xml_write_element(handle, "CaptureType", "Events");
for (i = 0; systems && systems[i]; i++)
- tracecmd_xml_write_element(handle, "System", systems[i]);
+ tracecmd_xml_write_element(handle, "System", "%s", systems[i]);
if (!events || events[0] < 0)
return;
@@ -1029,8 +1029,8 @@ static void save_events(struct trace_capture *cap,
event = pevent_find_event(pevent, events[i]);
if (event) {
tracecmd_xml_start_sub_system(handle, "Event");
- tracecmd_xml_write_element(handle, "System", event->system);
- tracecmd_xml_write_element(handle, "Name", event->name);
+ tracecmd_xml_write_element(handle, "System", "%s", event->system);
+ tracecmd_xml_write_element(handle, "Name", "%s", event->name);
tracecmd_xml_end_sub_system(handle);
}
}
@@ -1068,15 +1068,15 @@ static void save_settings(struct trace_capture *cap, const char *filename)
update_plugin(cap);
if (info->cap_plugin)
- tracecmd_xml_write_element(handle, "Plugin", info->cap_plugin);
+ tracecmd_xml_write_element(handle, "Plugin", "%s", info->cap_plugin);
command = gtk_entry_get_text(GTK_ENTRY(cap->command_entry));
if (command && strlen(command) && !is_just_ws(command))
- tracecmd_xml_write_element(handle, "Command", command);
+ tracecmd_xml_write_element(handle, "Command", "%s", command);
file = gtk_entry_get_text(GTK_ENTRY(cap->file_entry));
if (file && strlen(file) && !is_just_ws(file))
- tracecmd_xml_write_element(handle, "File", file);
+ tracecmd_xml_write_element(handle, "File", "%s", file);
tracecmd_xml_end_system(handle);
diff --git a/trace-dialog.c b/trace-dialog.c
index 5d3aabe..b5776cc 100644
--- a/trace-dialog.c
+++ b/trace-dialog.c
@@ -218,7 +218,7 @@ void warning(const char *fmt, ...)
errno = 0;
trace_dialog(GTK_WINDOW(parent_window), TRACE_GUI_WARNING,
- str->str);
+ "%s", str->str);
g_string_free(str, TRUE);
}
@@ -425,7 +425,7 @@ void trace_show_record_dialog(GtkWindow *parent, struct pevent *pevent,
if (s.buffer_size) {
trace_seq_terminate(&s);
- trace_dialog(parent, TRACE_GUI_OTHER, s.buffer);
+ trace_dialog(parent, TRACE_GUI_OTHER, "%s", s.buffer);
}
trace_seq_destroy(&s);
diff --git a/trace-filter.c b/trace-filter.c
index 1c36d84..bd8cb11 100644
--- a/trace-filter.c
+++ b/trace-filter.c
@@ -2043,7 +2043,7 @@ int trace_filter_save_events(struct tracecmd_xml_handle *handle,
&event_ids);
for (i = 0; systems && systems[i]; i++)
- tracecmd_xml_write_element(handle, "System", systems[i]);
+ tracecmd_xml_write_element(handle, "System", "%s", systems[i]);
for (i = 0; event_ids && event_ids[i] > 0; i++) {
str = pevent_filter_make_string(filter, event_ids[i]);
@@ -2060,11 +2060,11 @@ int trace_filter_save_events(struct tracecmd_xml_handle *handle,
}
tracecmd_xml_start_sub_system(handle, "Event");
- tracecmd_xml_write_element(handle, "System", event->system);
- tracecmd_xml_write_element(handle, "Name", event->name);
+ tracecmd_xml_write_element(handle, "System", "%s", event->system);
+ tracecmd_xml_write_element(handle, "Name", "%s", event->name);
/* If this is has an advanced filter, include that too */
if (strcmp(str, "TRUE") != 0) {
- tracecmd_xml_write_element(handle, "Advanced",
+ tracecmd_xml_write_element(handle, "Advanced", "%s",
str);
}
tracecmd_xml_end_sub_system(handle);
@@ -2088,7 +2088,7 @@ int trace_filter_save_tasks(struct tracecmd_xml_handle *handle,
for (i = 0; pids[i] >= 0; i++) {
snprintf(buffer, 100, "%d", pids[i]);
- tracecmd_xml_write_element(handle, "Task", buffer);
+ tracecmd_xml_write_element(handle, "Task", "%s", buffer);
}
free(pids);
--
2.11.0
next prev parent reply other threads:[~2017-06-15 0:29 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 0:27 [PATCH v3 0/6] trace-cmd: escape sequence, EINTR, error checking bug fixes Michael Sartain
2017-06-15 0:27 ` [PATCH v3 1/6] Fix bad force_token escape sequence Michael Sartain
2018-01-17 16:28 ` [tip:perf/core] tools lib traceevent: " tip-bot for Michael Sartain
2017-06-15 0:27 ` [PATCH v3 2/6] Fix unsigned return values being error checked as negative Michael Sartain
2017-06-15 0:27 ` [PATCH v3 3/6] Handle EINTR signal interrupts for read, write, open calls Michael Sartain
2017-06-21 13:26 ` Steven Rostedt
2017-06-15 0:27 ` [PATCH v3 4/6] Fix read / write data offsets in read / write loops Michael Sartain
2017-06-21 13:29 ` Steven Rostedt
2017-06-21 17:36 ` Michael Sartain
2017-06-15 0:28 ` [PATCH v3 5/6] Fix function prototypes for __vwarning, __vpr_stat, and __vdie Michael Sartain
2017-06-15 0:28 ` Michael Sartain [this message]
2017-08-02 22:15 [PATCH V3 1/2] use direname instead of custom code Federico Vaga
2017-08-02 22:15 ` [PATCH V3 2/2] It makes the code clearer and less error prone Federico Vaga
2017-08-14 17:33 ` Steven Rostedt
2017-08-15 7:25 ` Federico Vaga
2017-11-08 18:50 ` Steven Rostedt
2017-08-02 23:48 ` [PATCH V3 1/2] trace-cmd record: use direname instead of custom code Steven Rostedt
2017-08-14 17:14 ` [PATCH V3 1/2] " Steven Rostedt
2017-09-28 20:13 [PATCH][trace-cmd] Print value of unknown symbolic fields Jan Kiszka
2017-10-03 22:46 ` Steven Rostedt
2017-10-03 23:12 ` Steven Rostedt
2017-10-16 16:55 [PATCH v2 0/4] trace-cmd: Fixes for four minor bugs Michael Sartain
2017-10-16 16:55 ` [PATCH v2 1/4] trace-cmd: Fix incorrect malloc size arg: *item instead of item Michael Sartain
2017-10-16 16:55 ` [PATCH v2 2/4] trace-cmd: Fix NULL pointer being passed to memcpy Michael Sartain
2017-10-16 16:55 ` [PATCH v2 3/4] trace-cmd: Add UL suffix to MISSING_EVENTS since ints shouldn't be left shifted by 31 Michael Sartain
2017-10-16 16:55 ` [PATCH v2 4/4] trace-cmd: Use unsigned values in Hsieh's trace_hash fast hash function Michael Sartain
2018-01-12 0:47 [PATCH 00/10] tools lib traceveent: Pull updates from trace-cmd library Steven Rostedt
2018-01-12 0:47 ` [PATCH 01/10] lib, traceevent: Fix bad force_token escape sequence Steven Rostedt
2018-01-12 0:47 ` [PATCH 02/10] lib traceevent: Show value of flags that have not been parsed Steven Rostedt
2018-01-17 16:28 ` [tip:perf/core] tools " tip-bot for Steven Rostedt (VMware)
2018-01-12 0:47 ` [PATCH 03/10] lib traceevent: Print value of unknown symbolic fields Steven Rostedt
2018-01-17 16:28 ` [tip:perf/core] tools " tip-bot for Jan Kiszka
2018-01-12 0:47 ` [PATCH 04/10] lib traceevent: Simplify pointer print logic and fix %pF Steven Rostedt
2018-01-17 16:29 ` [tip:perf/core] tools " tip-bot for Steven Rostedt (VMware)
2018-01-12 0:47 ` [PATCH 05/10] lib traceevent: Handle new pointer processing of bprint strings Steven Rostedt
2018-01-17 16:29 ` [tip:perf/core] tools " tip-bot for Steven Rostedt (VMware)
2018-01-12 0:47 ` [PATCH 06/10] lib traceevent: Show contents (in hex) of data of unrecognized type records Steven Rostedt
2018-01-17 16:30 ` [tip:perf/core] tools " tip-bot for Steven Rostedt (VMware)
2018-01-12 0:47 ` [PATCH 07/10] lib traceevent: Use asprintf when possible Steven Rostedt
2018-01-17 16:30 ` [tip:perf/core] tools " tip-bot for Federico Vaga
2018-01-12 0:47 ` [PATCH 08/10] lib traceevent: Add UL suffix to MISSING_EVENTS Steven Rostedt
2018-01-17 16:31 ` [tip:perf/core] tools " tip-bot for Michael Sartain
2018-01-12 0:47 ` [PATCH 09/10] lib traceeevent: Fix missing break in FALSE case of pevent_filter_clear_trivial() Steven Rostedt
2017-04-26 14:55 ` [PATCH] parse-events: Fix the FALSE case in pevent_filter_clear_trivial() Taeung Song
2018-01-17 16:31 ` [tip:perf/core] tools lib traceevent: Fix missing break in FALSE case of pevent_filter_clear_trivial() tip-bot for Taeung Song
2018-01-12 1:00 ` [PATCH 09/10] lib traceeevent: " Taeung Song
2018-01-12 1:14 ` Steven Rostedt
2018-01-12 16:02 ` Arnaldo Carvalho de Melo
2018-01-12 0:47 ` [PATCH 10/10] lib traceevent: Fix get_field_str() for dynamic strings Steven Rostedt
2018-01-17 16:31 ` [tip:perf/core] tools " tip-bot for Steven Rostedt (VMware)
2018-01-17 6:02 ` [PATCH 00/10] tools lib traceveent: Pull updates from trace-cmd library Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c6a1d73387c9badf6b1e773d5fabb6a349838f46.1497486273.git.mikesart@fastmail.com \
--to=mikesart@fastmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).