linux-stable/tools
Arnaldo Carvalho de Melo 7125f20450 perf parse-events: Use asprintf() instead of strncpy() to read tracepoint files
Make the code more compact by using asprintf() instead of malloc()+strncpy() which also uses
less memory and avoids these warnings with gcc 10:

    CC       /tmp/build/perf/util/cloexec.o
  In file included from /usr/include/string.h:495,
                   from util/parse-events.h:12,
                   from util/parse-events.c:18:
  In function ‘strncpy’,
      inlined from ‘tracepoint_id_to_path’ at util/parse-events.c:271:5:
  /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ offset [275, 511] from the object at ‘sys_dirent’ is out of the bounds of referenced subobject ‘d_name’ with type ‘char[256]’ at offset 19 [-Werror=array-bounds]
    106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /usr/include/dirent.h:61,
                   from util/parse-events.c:5:
  util/parse-events.c: In function ‘tracepoint_id_to_path’:
  /usr/include/bits/dirent.h:33:10: note: subobject ‘d_name’ declared here
     33 |     char d_name[256];  /* We must not include limits.h! */
        |          ^~~~~~
  In file included from /usr/include/string.h:495,
                   from util/parse-events.h:12,
                   from util/parse-events.c:18:
  In function ‘strncpy’,
      inlined from ‘tracepoint_id_to_path’ at util/parse-events.c:273:5:
  /usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ offset [275, 511] from the object at ‘evt_dirent’ is out of the bounds of referenced subobject ‘d_name’ with type ‘char[256]’ at offset 19 [-Werror=array-bounds]
    106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /usr/include/dirent.h:61,
                   from util/parse-events.c:5:
  util/parse-events.c: In function ‘tracepoint_id_to_path’:
  /usr/include/bits/dirent.h:33:10: note: subobject ‘d_name’ declared here
     33 |     char d_name[256];  /* We must not include limits.h! */
        |          ^~~~~~
    CC       /tmp/build/perf/util/call-path.o

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20200302145535.GA28183@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-03-02 11:55:47 -03:00
..
accounting
arch tools headers UAPI: Update tools's copy of kvm.h headers 2020-02-27 09:51:30 -03:00
bootconfig tools/bootconfig: Suppress non-error messages 2020-02-10 17:22:56 -05:00
bpf bpftool: Don't crash on missing xlated program instructions 2020-02-07 22:29:45 +01:00
build perf/ui/gtk: Fix gtk2 build 2020-01-14 12:40:33 -03:00
cgroup iocost: Fix iocost_monitor.py due to helper type mismatch 2020-01-17 11:54:35 -08:00
debugging
firewire
firmware
gpio tools: gpio: Correctly add make dependencies for gpio_utils 2019-11-13 13:46:04 +01:00
hv Tools: hv: Reopen the devices if read() or write() returns errors 2020-01-26 22:10:10 -05:00
iio tools: iio: Correctly add make dependency for iio_utils 2019-11-10 17:11:06 +00:00
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-21 11:59:51 -08:00
io_uring
kvm/kvm_stat tools/kvm_stat: Fix kvm_exit filter name 2020-01-23 09:51:06 +01:00
laptop
leds
lib libbpf: Sanitise internal map names so they are not rejected by the kernel 2020-02-18 15:34:20 +01:00
memory-model
nfsd
objtool objtool: Fix ARCH=x86_64 build error 2020-01-22 07:54:57 +01:00
pci tools: PCI: Fix fd leakage 2019-10-29 12:04:18 +00:00
pcmcia
perf perf parse-events: Use asprintf() instead of strncpy() to read tracepoint files 2020-03-02 11:55:47 -03:00
power More power manadement updates for 5.6-rc1 2020-01-31 14:36:35 -08:00
scripts
spi
testing Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-02-21 11:59:51 -08:00
thermal/tmon
time
usb usbip: Fix unsafe unaligned pointer usage 2020-01-09 16:44:26 +01:00
virtio tools/virtio: xen stub 2019-10-13 09:38:27 -04:00
vm tools/vm/slabinfo: fix sanity checks enabling 2020-01-31 10:30:38 -08:00
wmi
Makefile tools: bootconfig: Add bootconfig command 2020-01-13 13:19:39 -05:00