Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp
Examining data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp
Examining data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp
Examining data/android-platform-system-extras-10.0.0+r36/app-launcher/computestats.c
Examining data/android-platform-system-extras-10.0.0+r36/app-launcher/computestatsf.c
Examining data/android-platform-system-extras-10.0.0+r36/boot_control_copy/boot_control_copy.cpp
Examining data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.cpp
Examining data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.h
Examining data/android-platform-system-extras-10.0.0+r36/bootctl/bootctl.cpp
Examining data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio.cpp
Examining data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp
Examining data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.h
Examining data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c
Examining data/android-platform-system-extras-10.0.0+r36/crypto-perf/crypto.cpp
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/blk_alloc_to_base_fs.cpp
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/ext4_sb.cpp
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/ext4_utils.cpp
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4_extents.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4_kernel_headers.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4_sb.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4_utils.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/jbd2.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/wipe.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/xattr.h
Examining data/android-platform-system-extras-10.0.0+r36/ext4_utils/wipe.cpp
Examining data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c
Examining data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.h
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.h
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark_subr.c
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/convert_format.c
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/dump_ioshark_filenames.c
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark.h
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.h
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_mmap.c
Examining data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c
Examining data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp
Examining data/android-platform-system-extras-10.0.0+r36/iotop/tasklist.cpp
Examining data/android-platform-system-extras-10.0.0+r36/iotop/tasklist.h
Examining data/android-platform-system-extras-10.0.0+r36/iotop/taskstats.cpp
Examining data/android-platform-system-extras-10.0.0+r36/iotop/taskstats.h
Examining data/android-platform-system-extras-10.0.0+r36/kexec_tools/kexec.h
Examining data/android-platform-system-extras-10.0.0+r36/kexec_tools/kexecload.c
Examining data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c
Examining data/android-platform-system-extras-10.0.0+r36/libfec/fec_open.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libfec/fec_private.h
Examining data/android-platform-system-extras-10.0.0+r36/libfec/fec_process.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libfec/fec_read.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libfec/fec_verity.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libfec/include/fec/ecc.h
Examining data/android-platform-system-extras-10.0.0+r36/libfec/include/fec/io.h
Examining data/android-platform-system-extras-10.0.0+r36/libfec/test/test_read.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libfec/test/test_rs.c
Examining data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt_init_extensions.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libfscrypt/include/fscrypt/fscrypt.h
Examining data/android-platform-system-extras-10.0.0+r36/libfscrypt/include/fscrypt/fscrypt_init_extensions.h
Examining data/android-platform-system-extras-10.0.0+r36/libjsonpb/parse/include/jsonpb/error_or.h
Examining data/android-platform-system-extras-10.0.0+r36/libjsonpb/parse/include/jsonpb/jsonpb.h
Examining data/android-platform-system-extras-10.0.0+r36/libjsonpb/parse/jsonpb.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libjsonpb/verify/include/jsonpb/json_schema_test.h
Examining data/android-platform-system-extras-10.0.0+r36/libjsonpb/verify/include/jsonpb/verify.h
Examining data/android-platform-system-extras-10.0.0+r36/libjsonpb/verify/test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libjsonpb/verify/verify.cpp
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/FileNode.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/HintManager.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/Node.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/NodeLooperThread.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/PropertyNode.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/RequestGroup.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/include/perfmgr/FileNode.h
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/include/perfmgr/HintManager.h
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/include/perfmgr/Node.h
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/include/perfmgr/NodeLooperThread.h
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/include/perfmgr/PropertyNode.h
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/include/perfmgr/RequestGroup.h
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/tests/FileNodeTest.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/tests/HintManagerTest.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/tests/NodeLooperThreadTest.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/tests/PropertyNodeTest.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/tests/RequestGroupTest.cc
Examining data/android-platform-system-extras-10.0.0+r36/libperfmgr/tools/ConfigVerifier.cc
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Action.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Action.h
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/LineBuffer.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/LineBuffer.h
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/NativeInfo.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/NativeInfo.h
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Pointers.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Pointers.h
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Thread.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Thread.h
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Threads.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/Threads.h
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/main.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/ActionTest.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/NativeInfoTest.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/PointersTest.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/ThreadTest.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/ThreadsTest.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp
Examining data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.h
Examining data/android-platform-system-extras-10.0.0+r36/mmap-perf/mmapPerf.cpp
Examining data/android-platform-system-extras-10.0.0+r36/mmap-perf/unsupported.cpp
Examining data/android-platform-system-extras-10.0.0+r36/multinetwork/common.cpp
Examining data/android-platform-system-extras-10.0.0+r36/multinetwork/common.h
Examining data/android-platform-system-extras-10.0.0+r36/multinetwork/dnschk.cpp
Examining data/android-platform-system-extras-10.0.0+r36/multinetwork/httpurl.cpp
Examining data/android-platform-system-extras-10.0.0+r36/pagecache/dumpcache.c
Examining data/android-platform-system-extras-10.0.0+r36/partition_tools/lpdump.cc
Examining data/android-platform-system-extras-10.0.0+r36/partition_tools/lpdump_host.cc
Examining data/android-platform-system-extras-10.0.0+r36/partition_tools/lpdump_target.cc
Examining data/android-platform-system-extras-10.0.0+r36/partition_tools/lpdumpd.cc
Examining data/android-platform-system-extras-10.0.0+r36/partition_tools/lpflash.cc
Examining data/android-platform-system-extras-10.0.0+r36/partition_tools/lpmake.cc
Examining data/android-platform-system-extras-10.0.0+r36/partition_tools/lpunpack.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/binder_interface/perfprofd_binder.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/binder_interface/perfprofd_binder.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/config.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/configreader.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/configreader.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/cpuconfig.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/cpuconfig.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/dropbox/dropbox.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/dropbox/dropbox.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/dropbox/dropbox_host.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/map_utils.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perf_data_converter.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perf_data_converter.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_cmdline.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_cmdline.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_io.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_io.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_perf.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_perf.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_record-fwd.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_threaded_handler.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdcore.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdcore.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdmain.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/quipper_helper.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/symbolizer.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/symbolizer.h
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc
Examining data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.h
Examining data/android-platform-system-extras-10.0.0+r36/preopt2cachename/preopt2cachename.cpp
Examining data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp
Examining data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c
Examining data/android-platform-system-extras-10.0.0+r36/runconuid/runconuid.cpp
Examining data/android-platform-system-extras-10.0.0+r36/sane_schedstat/sane_schedstat.c
Examining data/android-platform-system-extras-10.0.0+r36/showslab/showslab.c
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/CallChainJoiner.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/CallChainJoiner.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/CallChainJoiner_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/InplaceSamplerClient.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/InplaceSamplerClient.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/JITDebugReader.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/JITDebugReader.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/OfflineUnwinder.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/OfflineUnwinder.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/SampleComparator.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/SampleDisplayer.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/build_id.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/callchain.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_api.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_debug_unwind.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_debug_unwind_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_dumprecord.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_dumprecord_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_help.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_kmem.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_kmem_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_list.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_list_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_stat.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_stat_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_trace_sched.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_trace_sched_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/command.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/command.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/command_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/cpu_hotplug_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/demo/CppApi/app/src/main/cpp/native-lib.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/demo/SimpleperfExampleWithNative/app/src/main/cpp/native-lib.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/dso.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/dso.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/dso_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/environment_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_attr.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_attr.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_fd.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_fd.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_selection_set.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_selection_set.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_type.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_type.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/event_type_table.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/get_test_data.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/gtest_main.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/include/simpleperf.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/inplace_sampler_lib.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/inplace_sampler_lib.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/main.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/nonlinux_support/include/asm/byteorder.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/nonlinux_support/include/linux/ioctl.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/nonlinux_support/include/linux/types.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/nonlinux_support/nonlinux_support.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/perf_event.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/perf_regs.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/perf_regs.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_apk.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_apk.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_apk_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_dex_file.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_dex_file.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_dex_file_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_elf.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_elf.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/read_elf_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_equal_test.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_format.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_writer.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_lib_interface.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_lib_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/record_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/report_lib_interface.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/comm_change.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/function_fork.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/function_indirect_recursive.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/function_pthread.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/function_recursive.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/one_function.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/run_and_sleep.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/two_functions.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/sample_tree.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/sample_tree_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/simpleperf_app_runner/simpleperf_app_runner.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/test_util.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/testdata/elf_file_source.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/thread_tree.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/thread_tree.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/thread_tree_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/utils_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/workload.cpp
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/workload.h
Examining data/android-platform-system-extras-10.0.0+r36/simpleperf/workload_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/slideshow/slideshow.cpp
Examining data/android-platform-system-extras-10.0.0+r36/sound/playwav.c
Examining data/android-platform-system-extras-10.0.0+r36/squashfs_utils/squashfs_utils.c
Examining data/android-platform-system-extras-10.0.0+r36/squashfs_utils/squashfs_utils.h
Examining data/android-platform-system-extras-10.0.0+r36/su/su.cpp
Examining data/android-platform-system-extras-10.0.0+r36/taskstats/taskstats.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/audio/alsa/pcmtest.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/binder/benchmarks/binderAddInts.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/cpueater/cpueater.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/crypto/get_dm_versions.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/directiotest/directiotest.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/refresh.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/icachetest/Profiler.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/icachetest/Profiler.h
Examining data/android-platform-system-extras-10.0.0+r36/tests/icachetest/icache_main.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/iptables/qtaguid/socketTag.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_rec_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.h
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/mmc_max_speed_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/multicast_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/nfs_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/pstore_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/scrape_mmap_addr.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/sysvipc_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/include/testUtil.h
Examining data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/memeater/memeater.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/mmap_test.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/pageinout_test.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/pagingtest.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/pagingtest.h
Examining data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/thrashing_test.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/pftest/pftest.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/schedtest/schedtest.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/storage/opentest.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/storage/wipe_blkdev.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/suspend_stress/suspend_stress.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/tcp_nuke_addr/tcp_nuke_addr_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/timetest/rtc_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/tests/timetest/timetest.c
Examining data/android-platform-system-extras-10.0.0+r36/tests/uevents/uevents.c
Examining data/android-platform-system-extras-10.0.0+r36/toolchain-extras/profile-extras-test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/toolchain-extras/profile-extras.cpp
Examining data/android-platform-system-extras-10.0.0+r36/toolchain-extras/profile-extras.h
Examining data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree.cpp
Examining data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_main.cpp
Examining data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_test.cpp
Examining data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_utils.cpp
Examining data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_utils.h
Examining data/android-platform-system-extras-10.0.0+r36/verity/fec/image.cpp
Examining data/android-platform-system-extras-10.0.0+r36/verity/fec/image.h
Examining data/android-platform-system-extras-10.0.0+r36/verity/fec/main.cpp
Examining data/android-platform-system-extras-10.0.0+r36/verity/generate_verity_key.c
Examining data/android-platform-system-extras-10.0.0+r36/verity/hash_tree_builder.cpp
Examining data/android-platform-system-extras-10.0.0+r36/verity/include/verity/build_verity_tree.h
Examining data/android-platform-system-extras-10.0.0+r36/verity/include/verity/hash_tree_builder.h
Examining data/android-platform-system-extras-10.0.0+r36/verity/verity_verifier.cpp
Examining data/android-platform-system-extras-10.0.0+r36/zram-perf/zram-perf.cpp

FINAL RESULTS:

data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:124:29:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
        ssize_t exPathLen = readlink("/proc/self/exe", exPath, sizeof(exPath));
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_cmdline.cc:162:3:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
  chmod(produced_file_path.c_str(),
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:138:13:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        if (fscanf(fp, params, &cpu->utime, &cpu->ntime,
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:219:5:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    snprintf(buf, sizeof(buf), "%#" PRIx64, mtag);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:130:9:  [4] (shell) execl:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        execl(isExPathAvailable ? exPath : exName, exName, "--worker", arg, readFdStr, writeFdStr,
data/android-platform-system-extras-10.0.0+r36/bootctl/bootctl.cpp:85:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, errStr, ret.description().c_str());
data/android-platform-system-extras-10.0.0+r36/bootctl/bootctl.cpp:88:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, errStr, cr.errMsg.c_str());
data/android-platform-system-extras-10.0.0+r36/bootctl/bootctl.cpp:119:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, errStr, ret.description().c_str());
data/android-platform-system-extras-10.0.0+r36/bootctl/bootctl.cpp:122:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(stderr, errStr, "Invalid slot");
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio.cpp:61:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(SELF_IO, F_OK) == -1) {
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:183:13:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
            sprintf(filename, PID_STAT_FILE, pid);
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:185:13:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
            sprintf(filename, PID_CMDLINE_FILE, pid);
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:195:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
        sprintf(filename, PID_STAT_FILE, pid);
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:198:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
        sprintf(filename, PID_IO_FILE, pid);
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:50:20:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define die(...) { fprintf(stderr, __VA_ARGS__); exit(EXIT_FAILURE); }
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:255:9:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
        fscanf(file, scanline, &new_cpus[i].utime, &new_cpus[i].ntime, &new_cpus[i].stime,
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:137:6:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	if (sscanf(s, "%s", trace_type) != 1) {
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:216:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(pathname, s);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:239:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(syscall, s);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:272:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(protstr, s1);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:329:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(action, s);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:432:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(flags, s);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark_subr.c:187:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(filename_cache[filename_cache_num_entries].path,
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:776:9:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		(void)system("echo 3 > /proc/sys/vm/drop_caches");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:793:10:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
			(void)system("echo 3 > /proc/sys/vm/drop_caches");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:391:8:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	cmd = popen("getprop ro.product.name", "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:418:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(bdev, blockdev_name);
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:458:3:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
		sscanf(line,
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:499:2:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	sscanf(line, "%s %ju %ju %ju %ju %ju %ju %ju",
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:235:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(filename, THREAD_STATS_FILE_FORMAT, pid, tid);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:335:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
        sscanf(line, "%ld %ld %ld %s", &count, &total, &max, reason);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:348:17:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
                strcpy(e->reason, reason);
data/android-platform-system-extras-10.0.0+r36/libjsonpb/verify/include/jsonpb/json_schema_test.h:84:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(file_path_.c_str(), F_OK) == -1) {
data/android-platform-system-extras-10.0.0+r36/memory_replay/main.cpp:58:11:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
      if (sscanf(word, "free %" SCNxPTR, &pointer) == 1 && pointer != 0) {
data/android-platform-system-extras-10.0.0+r36/memory_replay/main.cpp:95:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if (sscanf(line, "%d: %s %" SCNxPTR " %n", &tid, type, &key_pointer, &line_pos) != 3) {
data/android-platform-system-extras-10.0.0+r36/pagecache/dumpcache.c:65:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(info->name, fpath);
data/android-platform-system-extras-10.0.0+r36/perfprofd/cpuconfig.cc:87:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    fprintf(fp, onoff ? "1\n" : "0\n");
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdcore.cc:160:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  if (access(pp.c_str(), R_OK|X_OK) == -1) {
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdcore.cc:258:5:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    execvp(argv[0], (char * const *)argv);
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdmain.cc:43:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
      if (access(config_directory.c_str(), F_OK) == -1) {
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdmain.cc:51:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
      if (access(semaphore_filepath.c_str(), F_OK) == -1) {
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:217:17:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      int ret = system(cmd.c_str());
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:347:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
      if (access(config_directory.c_str(), F_OK) == -1) {
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:355:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
      if (access(semaphore_filepath.c_str(), F_OK) == -1) {
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1550:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access(encoded_file_path(dest_dir, 0).c_str(), F_OK));
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1551:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access(encoded_file_path(dest_dir, 1).c_str(), F_OK));
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1552:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access(encoded_file_path(dest_dir, 2).c_str(), F_OK));
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc:68:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(buffer, tag);
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc:69:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(buffer+strlen(tag), LMAX, fmt, ap);
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc:78:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, ap); fprintf(stderr, "\n");
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc:87:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, ap); fprintf(stderr, "\n");
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc:96:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, ap); fprintf(stderr, "\n");
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:83:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(file_path, "%s/file_%lu", dir_path, id);
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:130:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(dir, "%s/%s", root_path, random_string);
data/android-platform-system-extras-10.0.0+r36/runconuid/runconuid.cpp:85:3:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  execvp(child_argv[0], child_argv);
data/android-platform-system-extras-10.0.0+r36/simpleperf/InplaceSamplerClient.cpp:121:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(msg->data, options.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.cpp:45:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, server_path.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp:296:7:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  if (system(copy_cmd.c_str()) != 0) {
data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp:301:7:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  if (system(test_cmd.c_str()) != 0) {
data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp:321:14:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  FILE* fp = popen("/system/bin/getprop security.perf_harden", "re");
data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp:382:5:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    execvp(argv[0], argv);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_dumprecord.cpp:156:9:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        printf(" %" PRId64, id);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_help.cpp:62:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  printf(
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:242:16:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    FILE* fp = popen("uname -m", "re");
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:117:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if (sscanf(lines[i].c_str(), "%lf%%%lf%%%s", &pair.first, &pair.second,
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:300:11:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
      if (sscanf(line.c_str(), "%*f%%%s%s", from, to) == 2) {
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:138:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
    if (sscanf(line, "%s%" PRIu64 "%*u%*s%*s 0x%" PRIx64, name, &len, &addr) == 3) {
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:711:5:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    execvp(argv[0], argv);
data/android-platform-system-extras-10.0.0+r36/simpleperf/event_type.cpp:134:5:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
    sscanf(s.c_str() + name.size(), ",%u,%" PRIu64, &type, &config);
data/android-platform-system-extras-10.0.0+r36/simpleperf/inplace_sampler_lib.cpp:180:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(msg->data, s);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:244:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, filename.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:295:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, filename.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:340:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, comm.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:362:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, name.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:791:9:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        printf(" %016" PRIx64, *p);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:909:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, filename.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:965:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, dso_name.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:1002:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(p, name.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/simpleperf_app_runner/simpleperf_app_runner.cpp:213:3:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  execvp(new_argv[0], new_argv);
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:83:15:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  std::string system;
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:158:63:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        "/sys/kernel/debug/tracing/events/%s/%s/format", type.system.c_str(),
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:166:29:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        std::make_pair(type.system, std::move(format_data)));
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:233:17:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    std::string system;
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:234:26:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    MoveFromBinaryFormat(system, p);
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:240:51:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      event_format_files.push_back(std::make_pair(system, std::move(format)));
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:59:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(cur_, s.data());
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:156:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vprintf(fmt, ap);
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:164:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(fp, fmt, ap);
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:354:15:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    int ret = sscanf(p, "%" PRIx64 " %c %s%s", &symbol.addr, &symbol.type, name, module);
data/android-platform-system-extras-10.0.0+r36/simpleperf/workload.cpp:46:13:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int ret = system(arg_str.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/workload.cpp:140:7:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      execvp(argv[0], argv);
data/android-platform-system-extras-10.0.0+r36/squashfs_utils/squashfs_utils.c:31:23:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define ERROR(x...)   fprintf(stderr, x)
data/android-platform-system-extras-10.0.0+r36/su/su.cpp:57:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(clobberablegids, uidgids);
data/android-platform-system-extras-10.0.0+r36/su/su.cpp:142:5:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    execvp(exec_args[0], exec_args);
data/android-platform-system-extras-10.0.0+r36/tests/audio/alsa/pcmtest.cpp:95:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
            sscanf(de->d_name, PCM_PREFIX "C%uD%u", &(pcmnodes[pcms].card),
data/android-platform-system-extras-10.0.0+r36/tests/audio/alsa/pcmtest.cpp:114:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
            sscanf(de->d_name, MIXER_PREFIX "C%u", &mixer);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:111:11:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
          execv(argv[0], argv);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:112:11:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
          execvp(argv[0], argv);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:143:10:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (!access("/dev/tty0", F_OK)) {
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/refresh.c:37:9:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
        snprintf(name, 64, device_template[i], 0);
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.cpp:106:12:  [4] (shell) execlp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
        if(execlp(exec_name, exec_name, lib_match, (char *) NULL)) {
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.cpp:184:10:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (!access(PROCFS_COMPAT_PATH, F_OK)) {
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.cpp:213:10:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (!access(PROCFS_COMPAT_PATH, F_OK)) {
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:21:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log/main", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:22:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log_main", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:23:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log/radio", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:24:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log_radio", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:25:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log/events", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:26:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log_events", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:27:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log/system", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/logger_test.cpp:28:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_NE(0, access("/dev/log_system", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/mmc_max_speed_test.cpp:21:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/sys/block/mmcblk0/max_read_speed", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/mmc_max_speed_test.cpp:22:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/sys/block/mmcblk0/max_write_speed", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/mmc_max_speed_test.cpp:23:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/sys/block/mmcblk0/cache_size", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/multicast_test.cpp:21:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/proc/net/igmp6", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/multicast_test.cpp:25:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/proc/net/igmp", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/pstore_test.cpp:22:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/sys/fs/pstore", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/pstore_test.cpp:26:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_TRUE(!access("/sys/fs/pstore/console-ramoops-0", F_OK) ^
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/pstore_test.cpp:27:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
              !access("/sys/fs/pstore/console-ramoops", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/pstore_test.cpp:31:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/dev/pmsg0", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/pstore_test.cpp:32:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(0, access("/sys/fs/pstore/pmsg-ramoops-0", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/sysvipc_test.cpp:83:17:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(-1, access("/proc/sysvipc", R_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/sysvipc_test.cpp:85:17:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(-1, access("/proc/sysvipc/msg", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/sysvipc_test.cpp:89:17:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(-1, access("/proc/sysvipc/sem", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/sysvipc_test.cpp:93:17:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  EXPECT_EQ(-1, access("/proc/sysvipc/shm", F_OK));
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:149:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(line, sizeof(line), fmt, args);
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:155:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stream, fmt, args);
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:402:15:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if ((fp = popen(cmd, "r")) == NULL) {
data/android-platform-system-extras-10.0.0+r36/tests/storage/opentest.c:59:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(dir, R_OK | W_OK)) {
data/android-platform-system-extras-10.0.0+r36/tests/timetest/rtc_test.cpp:32:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  int ret = access(rtc, flag & O_WRONLY);
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.h:30:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    fprintf(stderr, x);
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.h:32:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    fprintf(stderr, x); \
data/android-platform-system-extras-10.0.0+r36/zram-perf/zram-perf.cpp:148:14:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    result = system((string("mkswap ") + string(kZramBlkdevPath)).c_str());
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:541:19:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt(argc, argv, "a:s:t:h")) >= 0) {
data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp:68:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((c = getopt(argc, argv, "hi:d:o:s:")) != -1) {
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio.cpp:124:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, "hlpr:", longOptions, &optionIndex)) != -1) {
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:498:2:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	srand(gettid());
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:672:21:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        while ((c = getopt(argc, argv, "b:dn:st:qv")) != EOF) {
data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp:123:9:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    c = getopt_long(argc, argv, "ad:hm:n:Ps:", longopts, NULL);
data/android-platform-system-extras-10.0.0+r36/kexec_tools/kexecload.c:87:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "s:th", longopts, NULL);
data/android-platform-system-extras-10.0.0+r36/libperfmgr/tools/ConfigVerifier.cc:137:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        int c = getopt_long(argc, argv, "c:ehv", opts, &option_index);
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdcore.cc:585:17:  [3] (random) erand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  double frac = erand48(random_seed);
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1340:10:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
      I: random seed set to 12345678
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1428:12:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        I: random seed set to 12345678
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1449:12:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        I: random seed set to 12345678
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1493:12:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        I: random seed set to 12345678
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1559:10:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
      I: random seed set to 12345678
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:1630:10:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
      I: random seed set to 12345678
data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp:57:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((c = getopt(argc, argv, "n:rvb:")) != -1) {
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:65:31:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        return start + (((u64)random() << 31) | (u64)random()) % (end - start);
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:65:54:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
        return start + (((u64)random() << 31) | (u64)random()) % (end - start);
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:66:21:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    return start + (random() % (end - start));
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:70:18:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    return 'A' + random() % ('Z' - 'A');
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:81:10:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    base[random() % min(base_length, size)] = get_random_char();
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:213:19:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt(argc, argv, "s:h:t:")) != -1) {
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:248:5:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srandom(seed);
data/android-platform-system-extras-10.0.0+r36/runconuid/runconuid.cpp:147:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((c = getopt(argc, argv, optstr)) != -1) {
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:345:17:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    char* env = getenv("PERFPROFD_DISABLE_PERF_EVENT_PARANOID_CHANGE");
data/android-platform-system-extras-10.0.0+r36/slideshow/slideshow.cpp:93:19:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt(argc, argv, "t:")) != -1) {
data/android-platform-system-extras-10.0.0+r36/tests/binder/benchmarks/binderAddInts.cpp:262:19:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt(argc, argv, "s:c:d:?")) != -1) {
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:195:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((c = getopt(argc, argv, "+rwos:f:")) != -1) {
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:255:5:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srand(seed);
data/android-platform-system-extras-10.0.0+r36/tests/icachetest/icache_main.cpp:55:19:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    while ((opt = getopt_long(argc, argv, OPTSTR, OPTIONS, &option_index)) >= 0) {
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:185:11:  [3] (random) lrand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    val = lrand48();
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:189:12:  [3] (random) lrand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    val ^= lrand48() << 1;
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:208:56:  [3] (random) lrand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    uint32_t val = (mod <= lrand48maxVal) ? (uint32_t) lrand48() : testRand();
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:254:12:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    return drand48();
data/android-platform-system-extras-10.0.0+r36/tests/suspend_stress/suspend_stress.cpp:62:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        int c = getopt_long(argc, argv, "ac:t:", long_options, NULL);
data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_main.cpp:67:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    int c = getopt_long(argc, argv, "a:A:hSs:v", long_options, &option_index);
data/android-platform-system-extras-10.0.0+r36/verity/fec/main.cpp:296:17:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        int c = getopt_long(argc, argv, "hedSr:ij:s:E:V:p:v", long_options, nullptr);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:88:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char err_msg[100];
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:134:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((fp = fopen("/proc/stat", "r")) == NULL) {
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:192:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = open(path, O_WRONLY);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:218:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[64];
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:257:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char time_buf[time_buf_size];
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:258:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char path_buf[path_buf_size];
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:279:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int trace_fd = open(dfs_trace_output_path, O_RDWR);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:403:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = open(dfs_buffer_size_path, O_WRONLY);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:547:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                if (atoi(optarg) > max_buffer_size)
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:549:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                else if (atoi(optarg) < min_buffer_size)
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:555:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                threshold = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:119:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char readFdStr[16];
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:120:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char writeFdStr[16];
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:123:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char exPath[PATH_MAX];
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:170:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[256];
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:189:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    tasks = open(buf, O_WRONLY);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:218:30:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        write_oomadj_to_lmkd(atoi(argv[2]));
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:219:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        Pipe p{atoi(argv[3]), atoi(argv[4])};
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:219:31:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        Pipe p{atoi(argv[3]), atoi(argv[4])};
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:256:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char arg[16];
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:266:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char trace_str[64];
data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp:27:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open("/proc/self/oom_score_adj", O_WRONLY);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp:72:30:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                iterations = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp:75:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                duration = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp:81:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                step_size = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/app-launcher/computestats.c:20:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char in_buf[BUFSIZE];
data/android-platform-system-extras-10.0.0+r36/app-launcher/computestats.c:56:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		in_fp = fopen(in_file, "r");
data/android-platform-system-extras-10.0.0+r36/app-launcher/computestatsf.c:20:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char in_buf[BUFSIZE];
data/android-platform-system-extras-10.0.0+r36/app-launcher/computestatsf.c:56:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		in_fp = fopen(in_file, "r");
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/boot_control_copy.cpp:100:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char copy_buf[COPY_BUF_SIZE];
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/boot_control_copy.cpp:140:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char src_name[32];
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.cpp:94:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fd = open(path, flags);
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.h:30:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char bootctrl_suffix[4];
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio.cpp:79:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        timeout = atoi(components.at(LOG_TIMEOUT_INDEX).c_str());
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio.cpp:80:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        samples = atoi(components.at(LOG_SAMPLES_INDEX).c_str());
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:44:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(CPU_STAT_FILE, "r");
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:68:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[MAX_LINE];
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:71:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:93:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[MAX_LINE], *open_paren, *close_paren;
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:95:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:114:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[MAX_LINE], *open_paren, *close_paren;
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:116:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:148:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[MAX_LINE];
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:151:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:168:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char filename[64];
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:175:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        pid = atoi(pidDir->d_name);
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:86:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            iterations = atoi(argv[++i]);
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:95:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            delay = atoi(argv[++i]);
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:192:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[MAX_BUF_SIZE];
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:195:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:217:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char filename[MAX_BUF_SIZE];
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:221:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", cpu);
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:222:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:239:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char scanline[MAX_BUF_SIZE];
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:242:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen("/proc/stat", "r");
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:254:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(scanline, "cpu%d %%lu %%lu %%lu %%lu %%lu %%lu %%lu %%*d %%*d %%*d\n", i);
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:268:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char filename[MAX_BUF_SIZE];
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:271:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state", cpu);
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:272:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:303:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char label[8];
data/android-platform-system-extras-10.0.0+r36/cpustats/cpustats.c:311:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(label, "cpu%d", i);
data/android-platform-system-extras-10.0.0+r36/ext4_utils/blk_alloc_to_base_fs.cpp:40:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char filename[MAX_PATH+1], file_version[MAX_FILE_VERSION+1], *spaced_allocs = NULL;
data/android-platform-system-extras-10.0.0+r36/ext4_utils/blk_alloc_to_base_fs.cpp:47:22:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    blk_alloc_file = fopen(argv[1], "r");
data/android-platform-system-extras-10.0.0+r36/ext4_utils/blk_alloc_to_base_fs.cpp:52:20:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    base_fs_file = fopen(argv[2], "w");
data/android-platform-system-extras-10.0.0+r36/ext4_utils/ext4_utils.cpp:198:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(aux_info.sb, sb, sizeof(*sb));
data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4.h:416:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char s_volume_name[16];
data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4.h:417:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char s_last_mounted[64];
data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4.h:545:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
 char name[EXT4_NAME_LEN];
data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/ext4.h:553:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
 char name[EXT4_NAME_LEN];
data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/jbd2.h:57:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
 unsigned char h_padding[2];
data/android-platform-system-extras-10.0.0+r36/ext4_utils/include/ext4_utils/xattr.h:29:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char e_name[0];
data/android-platform-system-extras-10.0.0+r36/ext4_utils/wipe.cpp:59:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			char buf[4096] = {0};
data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c:204:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((fd = open(dev, O_RDONLY)) < 0) {
data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c:353:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[F2FS_BLKSIZE];
data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c:363:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&info->sit_sums->journal.n_sits, &buffer[SUM_JOURNAL_SIZE], SUM_JOURNAL_SIZE);
data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c:374:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(info->sit_sums, buffer, sizeof(struct f2fs_summary_block));
data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c:598:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((infd = open(in, O_RDONLY)) < 0) {
data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c:602:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((outfd = open(out, O_WRONLY|O_CREAT, S_IRUSR | S_IWUSR)) < 0) {
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:33:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char in_buf[2048];
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:172:2:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	bcopy(s2, s, strlen(s2) + 1);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:248:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char protstr[128];
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:524:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[512];
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:525:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char syscall[512];
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:526:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char lseek_action_str[512];
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:528:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char open_flags_str[64];
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:537:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char trace_type[64];
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:558:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fp = fopen(infile, "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:658:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fp = fopen(outfile, "w+");
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark_subr.c:134:23:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		filename_cache_fp = fopen("ioshark_filenames", "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark_subr.c:199:22:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	filename_cache_fp = fopen("ioshark_filenames", "w+");
data/android-platform-system-extras-10.0.0+r36/ioshark/convert_format.c:120:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	old_fp = fopen(infile, "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/convert_format.c:126:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	new_fp = fopen(outfile, "w+");
data/android-platform-system-extras-10.0.0+r36/ioshark/dump_ioshark_filenames.c:52:22:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	filename_cache_fp = fopen("ioshark_filenames", "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark.h:126:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[MAX_IOSHARK_PATHLEN];
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:169:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[MAX_IOSHARK_PATHLEN];
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:193:4:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
			sprintf(path, "file.%d.%"PRIu64"",
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:308:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			fd = open(files_db_get_filename(db_node),
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:331:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			fd = open(files_db_get_filename(db_node),
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:464:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			fd = open(files_db_get_filename(db_node),
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:554:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fp = fopen(infile, "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:681:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			num_iterations = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:688:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			num_threads = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:729:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fp = fopen(infile, "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:120:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
				fd = open(files_db_get_filename(db_node),
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:279:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0644);
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:388:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char dev_name[BUFSIZE];
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:411:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(bdev, "mmcblk0");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:416:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(bdev, "sda");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:431:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char line[BUFSIZE], dev_name[BUFSIZE];
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:440:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char blockdev_name[BUFSIZE];
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:443:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fp = fopen("/proc/uptime", "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:456:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fp = fopen("/proc/diskstats", "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:489:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char line[BUFSIZE], cpu[BUFSIZE];
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:492:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fp = fopen("/proc/stat", "r");
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:594:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open("ioshark_filenames", O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp:132:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      delay = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp:138:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      limit = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp:141:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      cycles = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/iotop/tasklist.cpp:40:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      pid_t pid = atoi(entry->d_name);
data/android-platform-system-extras-10.0.0+r36/kexec_tools/kexecload.c:117:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    atag_file = open(argv[0], O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/kexec_tools/kexecload.c:118:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    zimage_file = open(argv[1], O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:39:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char reason[MAX_LINE];
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:84:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            delay = atoi(argv[++i]);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:92:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            iterations = atoi(argv[++i]);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:104:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            pid = atoi(argv[++i]);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:112:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            tid = atoi(argv[++i]);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:178:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        f = fopen(GLOBAL_STATS_FILE, "w");
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:187:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    f = fopen(GLOBAL_STATS_FILE, "r");
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:201:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char dirname[MAX_FILENAME];
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:207:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(dirname, "/proc/%d/task", pid);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:220:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        tid = atoi(ent->d_name);
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:231:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char filename[MAX_FILENAME];
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:238:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        f = fopen(filename, "w");
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:252:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    f = fopen(GLOBAL_STATS_FILE, "r");
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:304:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    f = fopen(SYSCTL_FILE, "w");
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:317:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[MAX_LINE];
data/android-platform-system-extras-10.0.0+r36/latencytop/latencytop.c:319:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char reason[MAX_LINE];
data/android-platform-system-extras-10.0.0+r36/libfec/fec_open.cpp:544:32:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    f->fd = TEMP_FAILURE_RETRY(open(path, mode | O_CLOEXEC));
data/android-platform-system-extras-10.0.0+r36/libfec/fec_read.cpp:34:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char hex[bytes_per_line * 3 + 1];
data/android-platform-system-extras-10.0.0+r36/libfec/fec_read.cpp:35:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char prn[bytes_per_line + 1];
data/android-platform-system-extras-10.0.0+r36/libfec/fec_read.cpp:60:17:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
                strcpy(&hex[m * 3], "   ");
data/android-platform-system-extras-10.0.0+r36/libfec/fec_read.cpp:172:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(copy, &ecc_data[i * FEC_RSM], FEC_RSM);
data/android-platform-system-extras-10.0.0+r36/libfec/fec_read.cpp:271:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dest, &data[coff], copy);
data/android-platform-system-extras-10.0.0+r36/libfec/fec_read.cpp:392:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dest, &data[coff], copy);
data/android-platform-system-extras-10.0.0+r36/libfec/fec_verity.cpp:304:17:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                memcpy(data_hashes.get() + j * FEC_BLOCKSIZE, data,
data/android-platform-system-extras-10.0.0+r36/libfec/fec_verity.cpp:494:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(metadata.get(), &v->header, sizeof(v->header));
data/android-platform-system-extras-10.0.0+r36/libfec/fec_verity.cpp:500:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(metadata.get() + sizeof(v->header), v->table, len);
data/android-platform-system-extras-10.0.0+r36/libfec/include/fec/io.h:128:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
            open(fn, mode, flags, roots);
data/android-platform-system-extras-10.0.0+r36/libfec/include/fec/io.h:135:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        bool open(const std::string& fn, int mode = O_RDONLY, int flags = 0,
data/android-platform-system-extras-10.0.0+r36/libfec/test/test_rs.c:63:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dupl, corr, sizeof(corr));
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:57:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char value[PROPERTY_VALUE_MAX];
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:146:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char policy_hex[FS_KEY_DESCRIPTOR_SIZE_HEX];
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:149:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = open(directory, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC);
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:160:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(fp.master_key_descriptor, policy, FS_KEY_DESCRIPTOR_SIZE);
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:183:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = open(directory, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC);
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:207:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(policy, fp.master_key_descriptor, FS_KEY_DESCRIPTOR_SIZE);
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:220:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char existing_policy[FS_KEY_DESCRIPTOR_SIZE];
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:224:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char existing_policy_hex[FS_KEY_DESCRIPTOR_SIZE_HEX];
data/android-platform-system-extras-10.0.0+r36/libfscrypt/fscrypt.cpp:229:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char policy_hex[FS_KEY_DESCRIPTOR_SIZE_HEX];
data/android-platform-system-extras-10.0.0+r36/libperfmgr/FileNode.cc:59:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
            open(node_path_.c_str(), O_WRONLY | O_CLOEXEC | O_TRUNC)));
data/android-platform-system-extras-10.0.0+r36/memory_replay/NativeInfo.cpp:36:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char map_buffer[65535];
data/android-platform-system-extras-10.0.0+r36/memory_replay/NativeInfo.cpp:68:37:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  android::base::unique_fd smaps_fd(open("/proc/self/smaps", O_RDONLY));
data/android-platform-system-extras-10.0.0+r36/memory_replay/main.cpp:36:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char g_buffer[65535];
data/android-platform-system-extras-10.0.0+r36/memory_replay/main.cpp:88:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char type[128];
data/android-platform-system-extras-10.0.0+r36/memory_replay/main.cpp:171:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    max_threads = atoi(argv[2]);
data/android-platform-system-extras-10.0.0+r36/memory_replay/main.cpp:174:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int dump_fd = open(argv[1], O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp:46:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[100];
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp:65:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[100];
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp:86:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[100];
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp:115:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[100];
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp:145:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[24];
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp:180:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[60];
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/LineBufferTest.cpp:215:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[25];
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:39:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fd_ = open(filename, O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:63:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(data_, data_ + cur_idx_, len_);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:117:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(proc_file_, kProc, kProcLen);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:124:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(proc_file_ + kProcLen, pid_str, pid_str_len);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:125:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(proc_file_ + kProcLen + pid_str_len, kCmdline, kCmdlineLen);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:128:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int fd = open(proc_file_, O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:139:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(proc_file_ + kProcLen + pid_str_len, kSmaps, kSmapsLen);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:311:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      scan_delay_sec = atoi(argv[++i]);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.h:106:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char proc_file_[PATH_MAX];
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.h:107:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer_[kBufferLen];
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.h:109:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char cmd_name_[kCmdNameLen];
data/android-platform-system-extras-10.0.0+r36/mmap-perf/mmapPerf.cpp:59:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        int fd = open(name.c_str(), O_CREAT | O_RDWR, S_IRWXU);
data/android-platform-system-extras-10.0.0+r36/multinetwork/common.cpp:124:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char host[INET6_ADDRSTRLEN];
data/android-platform-system-extras-10.0.0+r36/multinetwork/common.cpp:125:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char port[sizeof("65535")];
data/android-platform-system-extras-10.0.0+r36/multinetwork/httpurl.cpp:130:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&(parameters->ss), result[0].ai_addr, result[0].ai_addrlen);
data/android-platform-system-extras-10.0.0+r36/multinetwork/httpurl.cpp:196:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[4*1024];
data/android-platform-system-extras-10.0.0+r36/pagecache/dumpcache.c:77:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open (fpath, O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/partition_tools/lpdump.cc:260:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd.reset(open(path.c_str(), flags));
data/android-platform-system-extras-10.0.0+r36/partition_tools/lpunpack.cc:149:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    unique_fd fd(open(super_path.c_str(), O_RDONLY | O_CLOEXEC));
data/android-platform-system-extras-10.0.0+r36/partition_tools/lpunpack.cc:234:25:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    unique_fd output_fd(open(output_path.c_str(), O_RDWR | O_CLOEXEC | O_CREAT | O_TRUNC, 0644));
data/android-platform-system-extras-10.0.0+r36/perfprofd/cpuconfig.cc:70:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *fp = fopen(possible.c_str(), "re");
data/android-platform-system-extras-10.0.0+r36/perfprofd/cpuconfig.cc:85:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *fp = fopen(ss.str().c_str(), "we");
data/android-platform-system-extras-10.0.0+r36/perfprofd/dropbox/dropbox.cc:49:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char path[PATH_MAX];
data/android-platform-system-extras-10.0.0+r36/perfprofd/dropbox/dropbox.cc:51:18:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    tmp_fd.reset(mkstemp(path));
data/android-platform-system-extras-10.0.0+r36/perfprofd/dropbox/dropbox.cc:67:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char fdpath[64];
data/android-platform-system-extras-10.0.0+r36/perfprofd/dropbox/dropbox.cc:69:21:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    read_only.reset(open(fdpath, O_RDONLY | O_CLOEXEC));
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_cmdline.cc:122:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *fp = fopen(processed_file_path.c_str(), "r");
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_cmdline.cc:135:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fp = fopen(produced_file_path.c_str(), "r");
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_cmdline.cc:152:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fp = fopen(produced_file_path.c_str(), "w");
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_io.cc:301:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  unique_fd fd(open(encoded_file_path, kFlags, 0664));
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofd_perf.cc:172:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *efp = fopen(perf_stderr_path.c_str(), "w");
data/android-platform-system-extras-10.0.0+r36/perfprofd/perfprofdcore.cc:253:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    const char *argv[10];
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:318:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    close(open(semaphore.c_str(), O_WRONLY|O_CREAT, 0600));
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:324:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *fp = fopen(processed.c_str(), "w");
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:365:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static const char *argv[3] = { "perfprofd", "-c", "" };
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:383:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *fp = fopen(config_path.c_str(), "w");
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:409:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *ifp = fopen(encoded_file_path(dest_dir, 0).c_str(), "r");
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:452:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(reinterpret_cast<uint8_t*>(const_cast<char*>(buf.data())) + index, chunk, amount);
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofd_test.cc:504:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      W: unable to open config directory /does/not/exist: No such file or directory
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc:67:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[LMAX];
data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp:17:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[64];
data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp:23:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE * file = fopen(filename, "r");
data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp:36:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char line[256];
data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp:66:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        iterations = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp:69:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        bufsz = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/pssbench/main.cpp:80:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  int pid = atoi(argv[optind]);
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:78:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char file_path[FILENAME_MAX];
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:84:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open(file_path, O_WRONLY | O_CREAT | O_SYNC, 0777);
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:122:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char random_string[15];
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:145:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char stay_dir[FILENAME_MAX], delete_dir[FILENAME_MAX];
data/android-platform-system-extras-10.0.0+r36/puncture_fs/puncture_fs.c:216:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                seed = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/sane_schedstat/sane_schedstat.c:144:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[4096];
data/android-platform-system-extras-10.0.0+r36/sane_schedstat/sane_schedstat.c:147:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd = open("/proc/schedstat", O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/showslab/showslab.c:20:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char name[SLABINFO_NAME_LEN];	/* name of this cache */
data/android-platform-system-extras-10.0.0+r36/showslab/showslab.c:64:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char line[SLABINFO_LINE_LEN];
data/android-platform-system-extras-10.0.0+r36/showslab/showslab.c:67:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	slabfile = fopen(SLABINFO_FILE, "r");
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:73:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[4096];
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:88:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[4096];
data/android-platform-system-extras-10.0.0+r36/simpleperf/OfflineUnwinder.cpp:72:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(&arm64_user_regs.regs[unwindstack::ARM64_REG_R0], &regs.data[PERF_REG_ARM64_X0],
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp:184:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(dest, buffer_ + pos, copy_size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp:186:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(static_cast<char*>(dest) + copy_size, buffer_, size - copy_size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp:503:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy(p, &new_header, sizeof(new_header));
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp:506:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy(p + stack_size_pos, &new_stack_size, sizeof(uint64_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp:509:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy(p + pos + new_stack_size, &new_stack_size, sizeof(uint64_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread_test.cpp:42:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, &header, sizeof(header));
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread_test.cpp:86:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(dest, record->Binary() + pos, size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread_test.cpp:165:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&buffer[data_pos], records[0]->Binary(), 4);
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread_test.cpp:166:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&buffer[0], records[0]->Binary() + 4, records[0]->size() - 4);
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread_test.cpp:169:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&buffer[pos], records[i]->Binary(), records[i]->size());
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.h:41:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char data[0];
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.h:71:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(data_.data() + write_head, &message, message.len);
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.h:74:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(data_.data() + write_head, &message, len1);
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.h:75:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(data_.data(), reinterpret_cast<const char*>(&message) + len1,
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket_test.cpp:28:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char data[10];
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket_test.cpp:44:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(send_msg.data, &send_data[send_bytes], n);
data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp:309:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[200];
data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp:413:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fp = fopen("/proc/self/cmdline", "r");
data/android-platform-system-extras-10.0.0+r36/simpleperf/build_id.h:42:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(data_, data, std::min(len, BUILD_ID_SIZE));
data/android-platform-system-extras-10.0.0+r36/simpleperf/build_id.h:89:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char data_[BUILD_ID_SIZE];
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_kmem.cpp:657:24:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    file_handler.reset(fopen(report_filename_.c_str(), "w"));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_kmem_test.cpp:75:34:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<TemporaryFile> tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_kmem_test.cpp:80:5:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    tmpfile.reset(new TemporaryFile);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_list.cpp:53:19:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_list.cpp:54:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE* fp = fopen(tmpfile.path, "w");
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_list.cpp:54:22:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    FILE* fp = fopen(tmpfile.path, "w");
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record.cpp:581:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[8192];
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:49:34:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<TemporaryFile> tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:54:5:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    tmpfile.reset(new TemporaryFile);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:95:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:96:46:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"-c", "100000"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:97:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckEventType(tmpfile.path, "cpu-cycles", 100000u, 0);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:106:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:107:42:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"-f", "99"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:108:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckEventType(tmpfile.path, "cpu-cycles", 0, 99u);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:109:61:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"-e", "cpu-clock", "-f", "99"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:110:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckEventType(tmpfile.path, "cpu-clock", 0, 99u);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:116:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:118:43:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
                            "cpu-clock"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:119:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckEventType(tmpfile.path, "cpu-cycles", 0, 99u);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:120:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckEventType(tmpfile.path, "cpu-clock", 1000000u, 0u);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:125:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:126:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "sleep", SLEEP_SEC}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:131:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:132:32:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:134:40:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:155:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:156:32:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:158:40:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:187:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:188:48:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"-e", event_name}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:189:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:243:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[40];
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:341:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:342:40:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_FALSE(RecordCmd()->Run({"-o", tmpfile.path}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:343:40:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_FALSE(RecordCmd()->Run({"-o", tmpfile.path, ""}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:379:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:380:51:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"--no-dump-symbols"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:382:21:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckKernelSymbol(tmpfile.path, true, &success);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:384:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"--no-dump-symbols", "--no-dump-kernel-symbols"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:385:21:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckKernelSymbol(tmpfile.path, false, &success);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:419:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:420:32:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:421:34:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(CheckDumpedSymbols(tmpfile.path, true));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:422:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"--no-dump-symbols", "--no-dump-kernel-symbols"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:423:34:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(CheckDumpedSymbols(tmpfile.path, false));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:429:47:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"-p", pid, "-g"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:430:34:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(CheckDumpedSymbols(tmpfile.path, true));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:432:28:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
                           tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:433:34:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(CheckDumpedSymbols(tmpfile.path, false));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:442:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:443:41:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"-a", "-o", tmpfile.path, "sleep", "1"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:444:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:480:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:482:65:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
                                std::to_string(getpid()), "-o", tmpfile.path, "--in-app"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:484:50:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      RecordCmd()->Run({"--duration", "1", "-o", tmpfile.path, "sleep", "2"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:498:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:503:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char data[8] = {};
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:508:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "--start_profiling_fd",
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:518:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:526:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "-t", std::to_string(tid), "--in-app"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:535:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:536:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "-p", pid, "--duration", "3"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:562:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:563:32:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:564:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:581:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:583:33:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      {"-e", "cpu-clock", "-o", tmpfile.path, "-p", pid, "--duration", "3"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:601:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:602:62:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RunRecordCmd({"--trace-offcpu", "-f", "1000"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:603:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:608:18:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  CheckEventType(tmpfile.path, "sched:sched_switch", 1u, 0u);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:621:19:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:622:58:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    ASSERT_TRUE(RunRecordCmd({"--clockid", "monotonic"}, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:623:81:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:635:19:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:636:54:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    ASSERT_TRUE(RecordCmd()->Run({"-e", event, "-o", tmpfile.path, "sleep", "1"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:637:81:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
    std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:658:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:659:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "--", "sleep", "1"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:667:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:668:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "-p", pid, "--size-limit", "1k", "--duration",
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:670:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:693:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:694:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "-p", pid, "--call-graph", "dwarf,8",
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:696:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:721:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:722:67:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-e", "sched:sched_switch", "-o", tmpfile.path, "-p", pid,
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:724:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:750:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:751:39:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(RecordCmd()->Run({"-o", tmpfile.path, "--app", app_name, "-g", "--duration", "3"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record_test.cpp:752:79:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::unique_ptr<RecordFileReader> reader = RecordFileReader::CreateInstance(tmpfile.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report.cpp:916:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    report_fp = fopen(report_filename_.c_str(), "w");
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample.cpp:157:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp.reset(fopen(report_filename_.c_str(), open_mode));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample.cpp:283:47:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(filename.c_str(), "rb"),
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample.cpp:289:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char magic[11] = {};
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp:34:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp:36:57:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      {"-i", GetTestData(PERF_DATA_WITH_SYMBOLS), "-o", tmpfile.path}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp:40:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp:42:45:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
                                      "-o", tmpfile.path, "--show-callchain"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp:47:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp:49:77:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  std::vector<std::string> args = {"-i", GetTestData(test_data_file), "-o", tmpfile.path,
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_sample_test.cpp:53:65:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(ReportSampleCmd()->Run({"--dump-protobuf-report", tmpfile.path,
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:115:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[1024];
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:298:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char from[80];
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:299:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char to[80];
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:354:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:355:69:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(ReportCmd()->Run({"-i", GetTestData(PERF_DATA), "-o", tmpfile.path}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:535:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile;
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:537:58:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
                                "--duration", "2", "-o", tmpfile.path, "-g"}));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_report_test.cpp:538:13:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ReportRaw(tmpfile.path, {"-g"});
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_stat.cpp:446:21:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp_holder.reset(fopen(output_filename_.c_str(), "we"));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cpu_hotplug_test.cpp:470:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        int second_count = atoi(argv[i+1]);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cpu_hotplug_test.cpp:480:33:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        int microsecond_count = atoi(argv[i+1]);
data/android-platform-system-extras-10.0.0+r36/simpleperf/demo/SimpleperfExampleWithNative/app/src/main/cpp/native-lib.cpp:40:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    return a + atoi("1");
data/android-platform-system-extras-10.0.0+r36/simpleperf/dso_test.cpp:33:17:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  TemporaryFile tmpfile(tmpdir.path);
data/android-platform-system-extras-10.0.0+r36/simpleperf/dso_test.cpp:36:54:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_TRUE(android::base::WriteStringToFile(data, tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/dso_test.cpp:39:71:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      "%s=%s\n", build_id.ToString().c_str(), android::base::Basename(tmpfile.path).c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/dso_test.cpp:45:71:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  ASSERT_EQ(finder.FindDebugFile("elf", false, build_id), std::string(tmpfile.path));
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:80:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fp = fopen("/sys/devices/system/cpu/online", "re");
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:125:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fp = fopen("/proc/modules", "re");
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:135:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[reader.MaxLineSize()];
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:553:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&s[0], reinterpret_cast<void*>(static_cast<uintptr_t>(vdso_map->start_addr)),
data/android-platform-system-extras-10.0.0+r36/simpleperf/event_fd.cpp:213:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&data[0], mmap_data_buffer_ + data_pos, copy_size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/event_fd.cpp:215:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(&data[copy_size], mmap_data_buffer_, data_size - copy_size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/inplace_sampler_lib.cpp:143:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        sample_freq_ = atoi(value);
data/android-platform-system-extras-10.0.0+r36/simpleperf/inplace_sampler_lib.cpp:145:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        signo_ = atoi(value);
data/android-platform-system-extras-10.0.0+r36/simpleperf/perf_regs.cpp:43:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      int version = atoi(&arch[4]);
data/android-platform-system-extras-10.0.0+r36/simpleperf/read_dex_file.cpp:82:50:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(file_path.c_str(), O_RDONLY | O_CLOEXEC)));
data/android-platform-system-extras-10.0.0+r36/simpleperf/read_elf.cpp:82:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[4];
data/android-platform-system-extras-10.0.0+r36/simpleperf/read_elf.cpp:94:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fp = fopen(filename.c_str(), mode.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/read_elf_test.cpp:39:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char build_id_data[20];
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:674:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(new_binary, binary_, callchain_pos);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:683:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, &stack_user_data.size, sizeof(uint64_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:688:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, &regs_user_data.abi, sizeof(uint64_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:692:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, branch_stack_data.stack, branch_stack_data.stack_nr * sizeof(BranchStackItemType));
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:695:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, &branch_stack_data.stack_nr, sizeof(uint64_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:699:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, raw_data.data, raw_data.size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:702:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p, &raw_data.size, sizeof(uint32_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:706:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p64, ips.data(), ips.size() * sizeof(uint64_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:710:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p64, callchain_data.ips, callchain_data.ip_nr * sizeof(uint64_t));
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:906:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p, build_id.Data(), build_id.Size());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:936:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p, kallsyms.data(), kallsyms_size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:1031:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p, tracing_data.data(), data_size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:1058:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p, data.data(), sizeof(uint64_t) * data.size());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_format.h:111:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char magic[8];
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_format.h:117:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char features[FEAT_MAX_NUM / 8];
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:74:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fp = fopen(filename.c_str(), mode.c_str());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:145:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&attr.ids, &buf[perf_event_attr_size], section_desc_size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:243:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char header_buf[Record::header_size()];
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:253:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char header_buf[Record::header_size()];
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:274:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p.get(), buf.data(), buf.size());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:277:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(p.get(), header_buf, Record::header_size());
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:388:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(binary, p, header->size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_test.cpp:70:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char p[BuildId::Size()];
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_writer.cpp:47:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fp = fopen(filename.c_str(), "web+");
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_writer.cpp:140:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char header_buf[Record::header_size()];
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_writer.cpp:258:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char align_buf[pad_size];
data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/function_fork.cpp:9:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  volatile int* p = a + atoi("0");
data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/function_fork.cpp:16:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  volatile int* p = a + atoi("1");
data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/two_functions.cpp:7:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  volatile int* p = a + atoi("0");
data/android-platform-system-extras-10.0.0+r36/simpleperf/runtest/two_functions.cpp:14:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  volatile int* p = a + atoi("1");
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:34:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
const char TRACING_INFO_MAGIC[10] = {23,  8,   68,  't', 'r',
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:103:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char magic[10];
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:120:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(magic, TRACING_INFO_MAGIC, sizeof(TRACING_INFO_MAGIC));
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.h:49:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char s[size + 1];
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.h:51:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(s, raw_data + offset, size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:67:33:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = TEMP_FAILURE_RETRY(open(filename.c_str(), O_RDONLY | O_BINARY));
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:72:33:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = TEMP_FAILURE_RETRY(open(filename.c_str(), O_WRONLY | O_BINARY | O_CREAT, 0644));
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:86:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[4];
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:349:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[line_size];
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:350:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char module[line_size];
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.h:95:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&data, p, sizeof(T));
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.h:102:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&data, p, sizeof(T));
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.h:110:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(data_p, p, size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.h:117:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p, &data, sizeof(T));
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.h:125:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(p, data_p, size);
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils_test.cpp:68:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[8];
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:47:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[8192];
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:50:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    afd = open("/dev/msm_pcm_out", O_RDWR);
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:132:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buf, next, sz);
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:158:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(fn, O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:196:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf[8192];
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:217:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open(fn, O_CREAT | O_RDWR, 0666);
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:224:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    afd = open("/dev/msm_pcm_in", O_RDWR);
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:299:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[64*1024];
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:303:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open(fn, O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:309:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    afd = open("/dev/msm_mp3", O_RDWR);
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:356:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            rate = atoi(argv[0]);
data/android-platform-system-extras-10.0.0+r36/squashfs_utils/squashfs_utils.c:66:38:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    data_device = TEMP_FAILURE_RETRY(open(blk_device, O_RDONLY | O_CLOEXEC));
data/android-platform-system-extras-10.0.0+r36/taskstats/taskstats.c:282:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                pid = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/taskstats/taskstats.c:286:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
                pid = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/tests/audio/alsa/pcmtest.cpp:215:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = open("/dev/snd/timer", O_RDWR | O_NONBLOCK);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/cpueater.c:51:21:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
                    open("/dev/null", 0);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/cpueater.c:53:24:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
                    if(open("/dev/null", O_WRONLY) < 0) {
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:37:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char lockid[32];
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:43:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  close(0); open("/dev/null", 0);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:59:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            delay = atoi(*argv);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:61:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            delay = atoi(*++argv);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:72:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      if(open(file, O_WRONLY|mode|O_CREAT, 0666) < 0) {
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:78:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      if(open("/dev/null", O_WRONLY) < 0) {
data/android-platform-system-extras-10.0.0+r36/tests/crypto/get_dm_versions.c:27:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[DM_CRYPT_BUF_SIZE];
data/android-platform-system-extras-10.0.0+r36/tests/crypto/get_dm_versions.c:32:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open("/dev/device-mapper", O_RDWR);
data/android-platform-system-extras-10.0.0+r36/tests/directiotest/directiotest.c:137:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char ascii_buf[17];
data/android-platform-system-extras-10.0.0+r36/tests/directiotest/directiotest.c:188:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_RDWR | O_DIRECT | O_LARGEFILE);
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:65:22:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        full_stats = fopen(full_stats_file, "w");
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:114:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[TST_BLK_SIZE] = { 0 };
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:149:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[TST_BLK_SIZE] = { 0 };
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:216:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            stats_count = atoi(optarg);
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:242:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((fd = open(argv[optind + 1], O_RDWR | o_sync)) < 0) {
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:247:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd2 = open("/dev/urandom", O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:58:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open("/dev/graphics/fb0", O_RDWR);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:61:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if ((fd = open("/dev/fb0", O_RDWR)) < 0) {
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:144:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd = open("/dev/tty0", O_RDWR | O_SYNC);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:263:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      bpp = atoi(argv[1]);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:266:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      id = !!atoi(argv[4]);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:271:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      w = atoi(argv[2]);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/fb_test.c:272:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      h = atoi(argv[3]);
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/refresh.c:35:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[64];
data/android-platform-system-extras-10.0.0+r36/tests/framebuffer/refresh.c:38:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fd = open(name, O_RDWR, 0);
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:57:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int write_fd = open(test_file_, O_CREAT | O_WRONLY, 0666);
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:64:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char read_buff[4];
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:65:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int read_fd = open(test_file_, O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:77:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char test_file_[FILENAME_MAX];
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:240:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      blk_fd_ = open(blk_path_.c_str(), O_RDWR);
data/android-platform-system-extras-10.0.0+r36/tests/iptables/qtaguid/socketTag.cpp:58:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    ctrl = open("/proc/net/xt_qtaguid/ctrl", O_RDWR);
data/android-platform-system-extras-10.0.0+r36/tests/iptables/qtaguid/socketTag.cpp:93:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    param_fd = open(filename.c_str(), O_WRONLY);
data/android-platform-system-extras-10.0.0+r36/tests/iptables/qtaguid/socketTag.cpp:211:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        dev_fd = open("/dev/xt_qtaguid", O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.cpp:69:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[MAX_ADDR_LEN];
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:145:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[MAXSTR];
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:321:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char line[MAXSTR];
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:395:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char str[MAXSTR];
data/android-platform-system-extras-10.0.0+r36/tests/memeater/memeater.c:32:28:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    int numMb = argc > 1 ? atoi(argv[1]) : 1;
data/android-platform-system-extras-10.0.0+r36/tests/memeater/memeater.c:57:21:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
                    open("/dev/null", 0);
data/android-platform-system-extras-10.0.0+r36/tests/memeater/memeater.c:83:25:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
                    if (open("/dev/null", O_WRONLY) < 0) {
data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/pagingtest.c:27:10:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    fd = mkstemp(filename);
data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/pagingtest.c:33:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    urandom = open("/dev/urandom", O_RDONLY);
data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/pagingtest.c:148:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        test_runs = atoi(argv[1]);
data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/thrashing_test.c:16:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmpnames[4][17] = { "thrashing1XXXXXX", "thrashing2XXXXXX", "thrashing3XXXXXX", "thrashing4XXXXXX" };
data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/thrashing_test.c:17:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    volatile char *bufs[4] = {0};
data/android-platform-system-extras-10.0.0+r36/tests/storage/opentest.c:33:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[16];
data/android-platform-system-extras-10.0.0+r36/tests/storage/opentest.c:43:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    nfiles = atoi(argv[2]);
data/android-platform-system-extras-10.0.0+r36/tests/storage/opentest.c:84:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        fds[i] = open(name, O_WRONLY | O_CREAT, 0666);
data/android-platform-system-extras-10.0.0+r36/tests/storage/wipe_blkdev.c:104:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open(devname, O_RDWR);
data/android-platform-system-extras-10.0.0+r36/tests/tcp_nuke_addr/tcp_nuke_addr_test.cpp:75:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&ifr.ifr_addr, &listenaddr, sizeof(listenaddr));
data/android-platform-system-extras-10.0.0+r36/tests/timetest/rtc_test.cpp:48:30:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    ret = TEMP_FAILURE_RETRY(open(rtc, flag));
data/android-platform-system-extras-10.0.0+r36/tests/timetest/timetest.c:74:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        clock_id = atoi(argv[1]);
data/android-platform-system-extras-10.0.0+r36/tests/uevents/uevents.c:25:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char msg[UEVENT_MSG_LEN+2];
data/android-platform-system-extras-10.0.0+r36/toolchain-extras/profile-extras.cpp:57:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char value[PROP_VALUE_MAX];
data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree.cpp:30:36:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  android::base::unique_fd data_fd(open(data_filename.c_str(), O_RDONLY));
data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_main.cpp:143:40:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    android::base::unique_fd random_fd(open("/dev/urandom", O_RDONLY));
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.cpp:85:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&ctx->input[ctx->pos], data, len);
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.cpp:159:37:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        int fd = TEMP_FAILURE_RETRY(open(fn.c_str(), flags | O_LARGEFILE));
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.cpp:176:33:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = TEMP_FAILURE_RETRY(open(filename.c_str(),
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.cpp:214:33:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = TEMP_FAILURE_RETRY(open(filename.c_str(), O_RDONLY));
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.cpp:310:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&header[sizeof(header) - sizeof(fec_header)], header,
data/android-platform-system-extras-10.0.0+r36/verity/fec/image.cpp:315:33:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = TEMP_FAILURE_RETRY(open(ctx->fec_filename,
data/android-platform-system-extras-10.0.0+r36/verity/fec/main.cpp:73:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&data[fcx->rs_n], &fcx->fec[ctx->fec_pos], fcx->roots);
data/android-platform-system-extras-10.0.0+r36/verity/generate_verity_key.c:73:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    f = fopen(pem_file, "r");
data/android-platform-system-extras-10.0.0+r36/verity/generate_verity_key.c:138:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    f = fopen(file, "w");
data/android-platform-system-extras-10.0.0+r36/verity/hash_tree_builder.cpp:171:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char hash_buffer[hash_size_];
data/android-platform-system-extras-10.0.0+r36/verity/hash_tree_builder.cpp:283:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      open(output.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666));
data/android-platform-system-extras-10.0.0+r36/verity/verity_verifier.cpp:82:31:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  android::base::unique_fd fd(open(argv[1], O_RDONLY));
data/android-platform-system-extras-10.0.0+r36/zram-perf/zram-perf.cpp:57:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        m_fd = open(path, O_RDWR | (direct ? O_DIRECT : 0));
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:199:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    ssize_t len = strlen(control);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:203:13:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
            usleep(100);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:225:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(mapp) > 0
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:260:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    ssize_t header_len = strlen(header);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:273:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (write(output_fd, header, strlen(header)) != header_len) {
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:309:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            result = read(trace_fd, in, bufSize);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:377:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(tracing_check_period);
data/android-platform-system-extras-10.0.0+r36/ANRdaemon/ANRdaemon.cpp:409:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    ssize_t len = strlen(buf_size_kb);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:80:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int error = read(m_readFd, &val, sizeof(val));
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:85:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int error = read(m_readFd, &val, sizeof(val));
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:93:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int error = read(m_readFd, &v, sizeof(T));
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:153:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(100000);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:195:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    write(tasks, buf, strlen(buf));
data/android-platform-system-extras-10.0.0+r36/alloc-stress/alloc-stress.cpp:229:13:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
            usleep(10 * 1000);
data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp:28:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    ret = write(fd, oom_score, strlen(oom_score));
data/android-platform-system-extras-10.0.0+r36/alloc-stress/mem-pressure.cpp:42:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(duration);
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/boot_control_copy.cpp:108:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      num_read = read(src_fd, copy_buf, num_to_read);
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.cpp:88:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    name_len = strlen(name);
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.cpp:90:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(path, record->blk_device.c_str(), trimmed_len);
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.cpp:91:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(path + trimmed_len, name, name_len);
data/android-platform-system-extras-10.0.0+r36/boot_control_copy/bootinfo.cpp:130:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    num_read = read(fd, (void*) out_info, sizeof(BrilloBootInfo));
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:155:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(line) > 0) {
data/android-platform-system-extras-10.0.0+r36/boottime_tools/bootio/bootio_collector.cpp:156:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        app->set_name(line, strlen(line));
data/android-platform-system-extras-10.0.0+r36/ext4_utils/blk_alloc_to_base_fs.cpp:61:21:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((c = fgetc(blk_alloc_file)) != EOF) {
data/android-platform-system-extras-10.0.0+r36/ext4_utils/ext4_utils.cpp:100:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, sb, sizeof(*sb));
data/android-platform-system-extras-10.0.0+r36/ext4_utils/ext4_utils.cpp:284:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, aux_info.bg_desc, info.block_size * aux_info.bg_desc_blocks);
data/android-platform-system-extras-10.0.0+r36/f2fs_utils/f2fs_sparseblock.c:172:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret = read(fd, buf, len);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark.c:172:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	bcopy(s2, s, strlen(s2) + 1);
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark_subr.c:71:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	hash = jenkins_one_at_a_time_hash(pathname, strlen(pathname));
data/android-platform-system-extras-10.0.0+r36/ioshark/compile_ioshark_subr.c:89:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	hash = jenkins_one_at_a_time_hash(filename, strlen(filename));
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:272:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(files_db_get_fd(db_node), p,
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench.c:437:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(file_op.delta_us);
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:405:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strncmp(dev_name, "bullhead", strlen("bullhead")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:406:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	    strncmp(dev_name, "angler", strlen("angler")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:407:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	    strncmp(dev_name, "shamu", strlen("shamu")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:408:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	    strncmp(dev_name, "aosp_gobo", strlen("aosp_gobo")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:409:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	    strncmp(dev_name, "full_k37_y33_gms", strlen("full_k37_y33_gms")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:410:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	    strncmp(dev_name, "fugu", strlen("fugu")) == 0) {
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:412:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	} else if (strncmp(dev_name, "marlin", strlen("marlin")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:413:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		   strncmp(dev_name, "sailfish", strlen("sailfish")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:414:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		   strncmp(dev_name, "taimen", strlen("taimen")) == 0 ||
data/android-platform-system-extras-10.0.0+r36/ioshark/ioshark_bench_subr.c:415:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		   strncmp(dev_name, "walleye", strlen("walleye")) == 0) {
data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp:83:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      {"read", make_sorter(&TaskStatistics::read, true)},
data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp:254:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        total_read += statistics.read();
data/android-platform-system-extras-10.0.0+r36/iotop/iotop.cpp:269:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            BytesToKB(statistics.read()) / delay_div,
data/android-platform-system-extras-10.0.0+r36/iotop/taskstats.h:36:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  uint64_t read() const { return read_bytes_; }
data/android-platform-system-extras-10.0.0+r36/libfec/fec_verity.cpp:43:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    check(2 * size == strlen(src));
data/android-platform-system-extras-10.0.0+r36/libfec/fec_verity.cpp:497:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(v->table);
data/android-platform-system-extras-10.0.0+r36/libfec/include/fec/io.h:154:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t read(void *buf, size_t count) {
data/android-platform-system-extras-10.0.0+r36/libfec/test/test_read.cpp:56:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        count = input.read(buffer.get(), bufsize);
data/android-platform-system-extras-10.0.0+r36/memory_replay/Action.cpp:140:20:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
    void* memory = memalign(align_, size_);
data/android-platform-system-extras-10.0.0+r36/memory_replay/LineBuffer.cpp:44:40:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t bytes = TEMP_FAILURE_RETRY(read(fd_, buffer_ + bytes_, buffer_len_ - bytes_ - 1));
data/android-platform-system-extras-10.0.0+r36/memory_replay/tests/ActionTest.cpp:133:18:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
TEST(ActionTest, memalign) {
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:69:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    bytes = read(fd_, data_ + len_, max_ - len_);
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:133:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t bytes = read(fd, cmd_name_, sizeof(cmd_name_));
data/android-platform-system-extras-10.0.0+r36/memtrack/memtrack.cpp:178:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    len = strlen(dir_data->d_name);
data/android-platform-system-extras-10.0.0+r36/multinetwork/httpurl.cpp:49:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strncmp(args.arg1, HTTP_PREFIX, strlen(HTTP_PREFIX)) != 0) {
data/android-platform-system-extras-10.0.0+r36/multinetwork/httpurl.cpp:54:54:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    parameters->host = std::string(args.arg1).substr(strlen(HTTP_PREFIX));
data/android-platform-system-extras-10.0.0+r36/pagecache/dumpcache.c:60:25:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    info->name = malloc(strlen(fpath) + 1);
data/android-platform-system-extras-10.0.0+r36/pagecache/dumpcache.c:146:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            strncmp("/dev", mentry->mnt_dir, strlen("/dev")) != 0 &&
data/android-platform-system-extras-10.0.0+r36/pagecache/dumpcache.c:147:46:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            strncmp("/sys", mentry->mnt_dir, strlen("/sys")) != 0 &&
data/android-platform-system-extras-10.0.0+r36/pagecache/dumpcache.c:148:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            strncmp("/proc", mentry->mnt_dir, strlen("/proc")) != 0) {
data/android-platform-system-extras-10.0.0+r36/partition_tools/lpmake.cc:176:59:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                if (!separator || separator == optarg || !strlen(separator + 1)) {
data/android-platform-system-extras-10.0.0+r36/perfprofd/binder_interface/perfprofd_binder.cc:219:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        stream.read(reinterpret_cast<char*>(buffer), size);
data/android-platform-system-extras-10.0.0+r36/perfprofd/tests/perfprofdmockutils.cc:69:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    vsnprintf(buffer+strlen(tag), LMAX, fmt, ap);
data/android-platform-system-extras-10.0.0+r36/runconuid/runconuid.cpp:140:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    group += strlen(group) + 1;
data/android-platform-system-extras-10.0.0+r36/sane_schedstat/sane_schedstat.c:149:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        i = read(fd, buf, sizeof(buf) - 1);
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:27:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
TEST(IOEventLoop, read) {
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:36:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int ret = read(fd[0], &c, 1);
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:52:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(1000);
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:85:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(500000);
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:87:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(1000);
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:89:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (read(fd[0], buf, sizeof(buf)) <= 0) {
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:114:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(1000);
data/android-platform-system-extras-10.0.0+r36/simpleperf/IOEventLoop_test.cpp:172:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(1000);
data/android-platform-system-extras-10.0.0+r36/simpleperf/InplaceSamplerClient.cpp:64:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(10);
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp:290:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    TEMP_FAILURE_RETRY(read(read_data_fd_, &dummy, 1));
data/android-platform-system-extras-10.0.0+r36/simpleperf/RecordReadThread.cpp:322:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  TEMP_FAILURE_RETRY(read(read_cmd_fd_, &dummy, 1));
data/android-platform-system-extras-10.0.0+r36/simpleperf/UnixSocket.cpp:164:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      TEMP_FAILURE_RETRY(read(fd_, &read_buffer_[read_buffer_size_],
data/android-platform-system-extras-10.0.0+r36/simpleperf/app_api/cpp/simpleperf.cpp:403:41:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t result = TEMP_FAILURE_RETRY(read(reply_fd_, &c, 1));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_api.cpp:150:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static_cast<void>(read(fd, &c, 1));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_api.cpp:183:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ssize_t nread = TEMP_FAILURE_RETRY(read(in_fd, buffer.data(), buffer.size()));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_debug_unwind.cpp:66:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      stat->vm_peak = android::base::Trim(line.substr(strlen("VmPeak:")));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_debug_unwind.cpp:68:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      stat->vm_size = android::base::Trim(line.substr(strlen("VmSize:")));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_debug_unwind.cpp:70:54:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      stat->vm_hwm = android::base::Trim(line.substr(strlen("VmHWM:")));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_debug_unwind.cpp:72:54:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      stat->vm_rss = android::base::Trim(line.substr(strlen("VmRSS:")));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_record.cpp:583:36:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t n = TEMP_FAILURE_RETRY(read(in_fd, buf, sizeof(buf)));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_stat.cpp:242:56:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            s.type_name.substr(0, s.type_name.size() - strlen("-misses")) + "s";
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_stat.cpp:253:75:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      std::string other_name = s.type_name.substr(0, s.type_name.size() - strlen("-refill"));
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_stat_test.cpp:83:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1);
data/android-platform-system-extras-10.0.0+r36/simpleperf/cmd_stat_test.cpp:142:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  pos += strlen("instructions:k");
data/android-platform-system-extras-10.0.0+r36/simpleperf/dso.cpp:355:50:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    return strncmp(&path_[pos], "TemporaryFile", strlen("TemporaryFile")) == 0;
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:412:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1);  // Wait 1us to avoid busy loop.
data/android-platform-system-extras-10.0.0+r36/simpleperf/environment.cpp:622:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1000);
data/android-platform-system-extras-10.0.0+r36/simpleperf/event_selection_set.cpp:68:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(1);
data/android-platform-system-extras-10.0.0+r36/simpleperf/event_selection_set.cpp:70:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1);  // Make a sched out to generate one sample.
data/android-platform-system-extras-10.0.0+r36/simpleperf/event_selection_set.cpp:73:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1);
data/android-platform-system-extras-10.0.0+r36/simpleperf/inplace_sampler_lib.cpp:175:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  size_t size = sizeof(UnixSocketMessage) + strlen(s) + 1;
data/android-platform-system-extras-10.0.0+r36/simpleperf/read_apk.cpp:152:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        size_t entry_name_start = strlen(prefix);
data/android-platform-system-extras-10.0.0+r36/simpleperf/read_apk.cpp:154:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        size_t zip_path_start = pos + strlen(key);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:212:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  p += Align(strlen(filename) + 1, 8);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:264:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  p += Align(strlen(filename) + 1, 8);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:319:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  p += Align(strlen(p) + 1, 8);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:352:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  size_t old_name_len = Align(strlen(comm) + 1, 8);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:884:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  p += Align(strlen(filename) + 1, 64);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:947:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  p += Align(strlen(dso_name) + 1, 8);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record.cpp:984:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  p += Align(strlen(name) + 1, 8);
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:483:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    const char* value = key + strlen(key) + 1;
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_reader.cpp:486:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    p = value + strlen(value) + 1;
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_writer.cpp:340:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size += strlen(symbol->Name()) + 1;
data/android-platform-system-extras-10.0.0+r36/simpleperf/record_file_writer.cpp:360:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    MoveToBinaryFormat(symbol->Name(), strlen(symbol->Name()) + 1, p);
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:44:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  data.insert(data.end(), s, s + strlen(s) + 1);
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:345:60:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          format.name = android::base::Trim(s.substr(pos + strlen("name:")));
data/android-platform-system-extras-10.0.0+r36/simpleperf/tracing.cpp:352:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
              strtoull(s.substr(pos + strlen("ID:")).c_str(), nullptr, 10);
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:351:5:  [1] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant character.
    strcpy(module, "");
data/android-platform-system-extras-10.0.0+r36/simpleperf/utils.cpp:363:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      size_t module_len = strlen(module);
data/android-platform-system-extras-10.0.0+r36/simpleperf/workload.cpp:128:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t nread = TEMP_FAILURE_RETRY(read(start_signal_fd, &start_signal, 1));
data/android-platform-system-extras-10.0.0+r36/simpleperf/workload.cpp:164:38:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t nread = TEMP_FAILURE_RETRY(read(exec_child_fd_, &exec_child_failed, 1));
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:146:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(fd, next, count) != (ssize_t) count) {
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:163:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) {
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:265:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while (read(0, &tmp, 1) == 1) {
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:268:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(afd, buf, sz) != (ssize_t) sz) {
data/android-platform-system-extras-10.0.0+r36/sound/playwav.c:320:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        r = read(fd, buf, 64*1024);
data/android-platform-system-extras-10.0.0+r36/squashfs_utils/squashfs_utils.c:72:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (TEMP_FAILURE_RETRY(read(data_device, &sb, sizeof(sb)))
data/android-platform-system-extras-10.0.0+r36/tests/audio/alsa/pcmtest.cpp:97:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            flags = de->d_name[strlen(de->d_name)-1];
data/android-platform-system-extras-10.0.0+r36/tests/binder/benchmarks/binderAddInts.cpp:120:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(500000); // 0.5 s
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/cpueater.c:41:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
            umask(0);
data/android-platform-system-extras-10.0.0+r36/tests/cpueater/daemonize.c:93:7:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      umask(0);
data/android-platform-system-extras-10.0.0+r36/tests/crypto/get_dm_versions.c:21:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(io->name, name, sizeof(io->name));
data/android-platform-system-extras-10.0.0+r36/tests/directiotest/directiotest.c:79:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, (char *)buf + bytes_read, count - bytes_read);
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:135:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:164:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
data/android-platform-system-extras-10.0.0+r36/tests/ext4/rand_emmc_perf.c:251:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(fd2, &seed, sizeof(seed)) != sizeof(seed)) {
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:53:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(test_file_, file_name, FILENAME_MAX);
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:67:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ASSERT_EQ(read(read_fd, read_buff, sizeof(read_buff)), 4);
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:87:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read(blk_fd, sb, sizeof(*sb)) != sizeof(*sb)) {
data/android-platform-system-extras-10.0.0+r36/tests/fstest/recovery_test.cpp:161:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(blk_fd, &gd, sizeof(gd)) != sizeof(gd)) {
data/android-platform-system-extras-10.0.0+r36/tests/icachetest/Profiler.h:187:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t n = read(mCountersFd[0], &counters, sizeof(Counters));
data/android-platform-system-extras-10.0.0+r36/tests/iptables/qtaguid/socketTag.cpp:78:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    res = write(ctrl, buff, strlen(buff));
data/android-platform-system-extras-10.0.0+r36/tests/iptables/qtaguid/socketTag.cpp:98:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    res = write(param_fd, data, strlen(data));
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.cpp:90:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        len = read(fd[0], buff, MAX_ADDR_LEN - 1);
data/android-platform-system-extras-10.0.0+r36/tests/kernel.config/aslr_test.cpp:112:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    return std::string(buff, strlen(buff));
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:409:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if ((strlen(str) > 1) && (str[strlen(str) - 1] == '\n')) {
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:409:39:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if ((strlen(str) > 1) && (str[strlen(str) - 1] == '\n')) {
data/android-platform-system-extras-10.0.0+r36/tests/lib/testUtil/testUtil.c:410:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            str[strlen(str) - 1] = '\0';
data/android-platform-system-extras-10.0.0+r36/tests/memeater/memeater.c:46:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
            umask(0);
data/android-platform-system-extras-10.0.0+r36/tests/memeater/memeater.c:92:25:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
                        usleep(1000000);
data/android-platform-system-extras-10.0.0+r36/tests/pagingtest/pagingtest.c:58:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        rc = read(urandom, tmp_buf, tmp_size);
data/android-platform-system-extras-10.0.0+r36/tests/schedtest/schedtest.c:34:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(1000);
data/android-platform-system-extras-10.0.0+r36/tests/suspend_stress/suspend_stress.cpp:145:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t bytes = read(fd, &fired, sizeof(fired));
data/android-platform-system-extras-10.0.0+r36/tests/tcp_nuke_addr/tcp_nuke_addr_test.cpp:74:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(ifr.ifr_name, "lo", strlen("lo"));
data/android-platform-system-extras-10.0.0+r36/tests/tcp_nuke_addr/tcp_nuke_addr_test.cpp:74:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    strncpy(ifr.ifr_name, "lo", strlen("lo"));
data/android-platform-system-extras-10.0.0+r36/tests/timetest/rtc_test.cpp:108:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(timeout_sleep);
data/android-platform-system-extras-10.0.0+r36/tests/timetest/rtc_test.cpp:145:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(timeout_sleep);
data/android-platform-system-extras-10.0.0+r36/toolchain-extras/profile-extras.cpp:95:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strncmp(prog_basename, "zygote", strlen("zygote")) == 0) {
data/android-platform-system-extras-10.0.0+r36/toolchain-extras/profile-extras.cpp:98:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strncmp(prog_basename, "app_process", strlen("app_process")) == 0) {
data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_main.cpp:75:49:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        salt.insert(salt.end(), optarg, &optarg[strlen(optarg)]);
data/android-platform-system-extras-10.0.0+r36/verity/build_verity_tree_main.cpp:149:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t ret = read(random_fd, salt.data(), salt.size());
data/android-platform-system-extras-10.0.0+r36/verity/hash_tree_builder.cpp:263:22:  [1] (buffer) mismatch:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    auto iter = std::mismatch(level_blocks.begin(), level_blocks.end(),
data/android-platform-system-extras-10.0.0+r36/zram-perf/zram-perf.cpp:94:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ssize_t ret = read(m_fd, page.ptr(), kPageSize);

ANALYSIS SUMMARY:

Hits = 846
Lines analyzed = 70056 in approximately 2.03 seconds (34582 lines/second)
Physical Source Lines of Code (SLOC) = 53333
Hits@level = [0] 890 [1] 160 [2] 516 [3]  37 [4] 131 [5]   2
Hits@level+ = [0+] 1736 [1+] 846 [2+] 686 [3+] 170 [4+] 133 [5+]   2
Hits/KSLOC@level+ = [0+] 32.5502 [1+] 15.8626 [2+] 12.8626 [3+] 3.18752 [4+] 2.49377 [5+] 0.0375002
Dot directories skipped = 4 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.