linux-stable/tools/perf
Arnaldo Carvalho de Melo 7572588085 perf header: Fix unchecked usage of strncpy()
The strncpy() function may leave the destination string buffer
unterminated, better use strlcpy() that we have a __weak fallback
implementation for systems without it.

This fixes this warning on an Alpine Linux Edge system with gcc 8.2:

  util/header.c: In function 'perf_event__synthesize_event_update_unit':
  util/header.c:3586:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
    strncpy(ev->data, evsel->unit, size);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  util/header.c:3579:16: note: length computed here
    size_t size = strlen(evsel->unit);
                  ^~~~~~~~~~~~~~~~~~~

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: a6e5281780 ("perf tools: Add event_update event unit type")
Link: https://lkml.kernel.org/n/tip-fiikh5nay70bv4zskw2aa858@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-12-17 14:59:06 -03:00
..
arch perf tools: Fix diverse comment typos 2018-12-17 14:56:47 -03:00
bench perf bench: Add epoll_ctl(2) benchmark 2018-11-21 22:39:55 -03:00
Documentation perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
examples/bpf Revert "perf augmented_syscalls: Drop 'write', 'poll' for testing without self pid filter" 2018-11-21 12:00:31 -03:00
include/bpf perf bpf: Reduce the hardcoded .max_entries for pid_maps 2018-11-21 12:00:32 -03:00
jvmti perf jvmti: Separate jvmti cmlr check 2018-11-21 22:39:58 -03:00
pmu-events perf vendor events intel: Fix diverse typos 2018-12-17 14:56:31 -03:00
python
scripts perf scripts python: exported-sql-viewer.py: Fix table find when table re-ordered 2018-11-05 14:53:00 -03:00
tests perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
trace perf beauty mmap_flags: Fixed syntax error Fixed missing ']' error 2018-12-17 14:56:13 -03:00
ui perf top: Move perf_top__reset_sample_counters() to after counts display 2018-12-17 14:58:47 -03:00
util perf header: Fix unchecked usage of strncpy() 2018-12-17 14:59:06 -03:00
.gitignore
Build
builtin-annotate.c perf tools: Remove perf_tool from event_op2 2018-09-19 10:25:10 -03:00
builtin-bench.c perf bench: Add epoll_ctl(2) benchmark 2018-11-21 22:39:55 -03:00
builtin-buildid-cache.c perf buildid-cache: Warn --purge-all failures 2018-05-15 10:32:16 -03:00
builtin-buildid-list.c
builtin-c2c.c perf c2c report: Fix crash for empty browser 2018-07-31 10:53:20 -03:00
builtin-config.c
builtin-data.c
builtin-diff.c perf hists: Clarify callchain disabling when available 2018-07-24 14:37:33 -03:00
builtin-evlist.c
builtin-ftrace.c
builtin-help.c
builtin-inject.c perf tools: Report itrace options in help 2018-09-19 15:06:59 -03:00
builtin-kallsyms.c perf machine: Ditch find_kernel_function variants 2018-04-30 12:20:54 -03:00
builtin-kmem.c tools lib traceevent, perf tools: Rename 'enum pevent_flag' to 'enum tep_flag' 2018-08-13 15:22:18 -03:00
builtin-kvm.c perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
builtin-list.c
builtin-lock.c
builtin-mem.c
builtin-probe.c perf tools: No need to check if the argument to __get() function is NULL 2018-06-04 10:28:50 -03:00
builtin-record.c perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00
builtin-report.c perf report: Display average IPC and IPC coverage per symbol 2018-12-17 14:55:44 -03:00
builtin-sched.c perf sched: Use sched->show_callchain where appropriate 2018-06-05 10:09:54 -03:00
builtin-script.c perf tools: Support 'srccode' output 2018-12-17 14:57:07 -03:00
builtin-stat.c perf evlist: Move perf_evsel__reset_weak_group into evlist 2018-11-05 14:37:09 -03:00
builtin-timechart.c perf thread: Make thread__find_symbol() return the symbol searched 2018-04-26 13:47:09 -03:00
builtin-top.c perf top: Move perf_top__reset_sample_counters() to after counts display 2018-12-17 14:58:47 -03:00
builtin-trace.c perf trace: We need to consider "nr" if "__syscall_nr" is not there 2018-12-17 14:57:02 -03:00
builtin-version.c
builtin.h
check-headers.sh tools include uapi: Grab a copy of linux/fs.h 2018-10-30 11:46:22 -03:00
command-list.txt perf help: Add missing subcommand version 2018-09-19 14:53:36 -03:00
CREDITS
design.txt
Makefile perf tools: Disable parallelism for 'make clean' 2018-08-20 08:54:58 -03:00
Makefile.config tools build feature: Check if libaio is available 2018-12-17 14:54:54 -03:00
Makefile.perf perf beauty mmap_flags: Check if the arch has a mmap.h file 2018-12-17 14:55:14 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Remove dead quote.[ch] code 2018-06-04 10:28:50 -03:00
perf.h perf tools: Allow specifying proc-map-timeout in config file 2018-12-17 14:56:57 -03:00