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/libpfm4-4.11.1+git4-gfa84c27/examples/check_events.c Examining data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/include/perfmon/err.h Examining data/libpfm4-4.11.1+git4-gfa84c27/include/perfmon/perf_event.h Examining data/libpfm4-4.11.1+git4-gfa84c27/include/perfmon/pfmlib.h Examining data/libpfm4-4.11.1+git4-gfa84c27/include/perfmon/pfmlib_perf_event.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam10h.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam11h.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam12h.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam14h.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam15h.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam15h_nb.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam16h.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam17h_zen1.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_fam17h_zen2.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_k7.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/amd64_events_k8.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_1176_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_cavium_tx2_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_cortex_a15_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_cortex_a53_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_cortex_a57_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_cortex_a7_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_cortex_a8_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_cortex_a9_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_fujitsu_a64fx_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_marvell_tx2_unc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_neoverse_n1_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_qcom_krait_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/arm_xgene_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/cell_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_atom_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_cbo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_ha_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_imc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_irp_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_pcu_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_r2pcie_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_r3qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_sbo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdx_unc_ubo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_core_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_coreduo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_glm_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hsw_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_cbo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_ha_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_imc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_irp_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_pcu_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_r2pcie_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_r3qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_sbo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_hswep_unc_ubo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_icl_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivb_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_cbo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_ha_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_imc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_irp_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_pcu_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_r2pcie_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_r3qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ivbep_unc_ubo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_knc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_knl_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_knl_unc_cha_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_knl_unc_edc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_knl_unc_imc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_knl_unc_m2pcie_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_netburst_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_nhm_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_nhm_unc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_p6_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_pii_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_pm_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_ppro_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skl_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_cha_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_iio_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_imc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_irp_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_m2m_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_m3upi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_pcu_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_ubo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_skx_unc_upi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_slm_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snb_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snb_unc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_cbo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_ha_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_imc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_pcu_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_r2pcie_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_r3qpi_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_snbep_unc_ubo_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_tmt_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_wsm_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_wsm_unc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_x86_arch_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/itanium2_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/itanium_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/mips_74k_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/montecito_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/perf_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/power4_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/power5+_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/power5_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/power6_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/power7_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/powerpc_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/powerpc_nest_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/ppc970_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/ppc970mp_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/s390x_cpumf_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/sparc_niagara1_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/sparc_niagara2_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/sparc_ultra12_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/sparc_ultra4plus_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/torrent_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/sparc_ultra3_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/sparc_ultra3i_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/sparc_ultra3plus_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/intel_bdw_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/power8_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/events/power9_events.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_fam10h.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_fam11h.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_fam12h.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_fam14h.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_fam15h.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_fam16h.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_fam17h.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_k7.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_k8.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm_armv6.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm_armv7_pmuv1.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm_armv8.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_cell.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_cell_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_ia64_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_atom.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdw.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_cbo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_ha.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_imc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_irp.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_pcu.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_r2pcie.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_r3qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_sbo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_bdx_unc_ubo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_core.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_coreduo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_glm.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hsw.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_cbo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_ha.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_imc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_irp.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_pcu.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_r2pcie.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_r3qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_sbo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_hswep_unc_ubo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_icl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivb.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivb_unc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_cbo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_ha.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_imc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_irp.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_pcu.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_r2pcie.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_r3qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_ivbep_unc_ubo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_knc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_knl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_knl_unc_cha.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_knl_unc_edc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_knl_unc_imc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_knl_unc_m2pcie.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_netburst.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_netburst_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_netburst_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm_unc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_p6.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_rapl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_cha.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_iio.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_imc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_irp.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_m2m.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_m3upi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_pcu.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_ubo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_skx_unc_upi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_slm.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snb.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snb_unc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_cbo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_ha.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_imc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_pcu.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_r2pcie.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_r3qpi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_ubo.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_tmt.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_wsm.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_arch.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips_74k.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_montecito.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_montecito_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_raw.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_power4.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_power5.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_power6.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_power7.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_power8.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_power9.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_power_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_powerpc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_powerpc_nest.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_powerpc_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_ppc970.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc_niagara.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc_priv.h Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc_ultra12.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc_ultra3.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc_ultra4.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_torrent.c Examining data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_tx2_unc_perf_event.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/evt2raw.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/notify_group.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/notify_self.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/perf_util.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/perf_util.h Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_basic.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_count.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/x86/bts_smpl.c Examining data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c Examining data/libpfm4-4.11.1+git4-gfa84c27/tests/validate.c Examining data/libpfm4-4.11.1+git4-gfa84c27/tests/validate_arm.c Examining data/libpfm4-4.11.1+git4-gfa84c27/tests/validate_arm64.c Examining data/libpfm4-4.11.1+git4-gfa84c27/tests/validate_mips.c Examining data/libpfm4-4.11.1+git4-gfa84c27/tests/validate_perf.c Examining data/libpfm4-4.11.1+git4-gfa84c27/tests/validate_power.c Examining data/libpfm4-4.11.1+git4-gfa84c27/tests/validate_x86.c FINAL RESULTS: data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:337:2: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(debugfs_mnt, "/tracing/events", MAXPATHLEN-1); data/libpfm4-4.11.1+git4-gfa84c27/examples/check_events.c:153:4: [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(" 0x%"PRIx64, e.codes[j]); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:84:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "%s=%s", var, value); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:121:4: [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("0x%"PRIx64, codes[j]); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:310:4: [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("0x%-10"PRIx64, info->code); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:567:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fullname, "%s::%s", pinfo.name, info.name); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:642:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fullname, "%s::%s", pinfo.name, info.name); data/libpfm4-4.11.1+git4-gfa84c27/include/perfmon/err.h:28: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, __VA_ARGS__); \ data/libpfm4-4.11.1+git4-gfa84c27/include/perfmon/err.h:33: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, __VA_ARGS__); \ data/libpfm4-4.11.1+git4-gfa84c27/include/perfmon/err.h:39: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, __VA_ARGS__); \ data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_perf_event.c:44:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "/sys/bus/event_source/devices/%s/type", name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:599:2: [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(pfm_cfg.fp, fmt, ap); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:612:2: [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(pfm_cfg.fp, fmt, ap); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:684:2: [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(str+len, todo, fmt, ap); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:921:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(*fstr, "%s::%s", e->pmu->name, e->fstr); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:977: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 (buffer, pfm_cfg.blacklist_pmus); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1836:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s::%s:%s", pmu->name, einfo.name, ainfo.name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1855:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s::%s", pmu->name, einfo.name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_perf_event.c:46:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "/sys/bus/event_source/devices/%s/type", name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_perf_event.c:45:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "/sys/bus/event_source/devices/%s/type", name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_perf_event.c:352: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. return access(file, R_OK|X_OK) ? PFM_ERR_NOTSUPP : PFM_SUCCESS; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips.c:147: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(pfm_mips_cfg.model, buffer); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event.c:429:12: [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(PERF_PROC_FILE, F_OK); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:493: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. return !(access(PERF_PROC_FILE, F_OK) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:494:8: [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(PERF_OLD_PROC_FILE, F_OK)) ? PFM_SUCCESS: PFM_ERR_NOTSUPP; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_raw.c:41: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. return !(access(PERF_PROC_FILE, F_OK) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_raw.c:42:8: [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(PERF_OLD_PROC_FILE, F_OK)) ? PFM_SUCCESS: PFM_ERR_NOTSUPP; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_raw.c:144:8: [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. ret = sscanf(s+1, "%"PRIx64, &code); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_powerpc_perf_event.c:67:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "/sys/bus/event_source/devices/%s/type", name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:50:6: [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(CPUM_CF_DEVICE_DIR, R_OK)) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:57:6: [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(CPUM_SF_DEVICE_DIR, R_OK)) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:74: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(tmp,F_OK) == 0) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:81: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(tmp,F_OK) == 0) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_tx2_unc_perf_event.c:52:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "/sys/bus/event_source/devices/%s/type", name); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c:70:2: [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(arg[0], arg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c:143:2: [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); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:104: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(buf, mountpoint); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:270: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(buf, mountpoint); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c:59:2: [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(arg[0], arg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c:128:8: [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. while(access(fn, F_OK) == 0 && options.delay) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c:62:2: [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(arg[0], arg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c:84:2: [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(arg[0], arg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/x86/bts_smpl.c:86:2: [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(arg[0], arg); data/libpfm4-4.11.1+git4-gfa84c27/tests/validate.c:57:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "%s=%s", var, value); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:817:12: [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,"hELsm:MNl:F:x:DO:")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:869:8: [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. str = getenv("LIBPFM_VERBOSE"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:873:8: [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. str = getenv("LIBPFM_DEBUG"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:877:8: [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. str = getenv("LIBPFM_DEBUG_STDOUT"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:881:23: [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. pfm_cfg.forced_pmu = getenv("LIBPFM_FORCE_PMU"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:883:8: [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. str = getenv("LIBPFM_ENCODE_INACTIVE"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:887:8: [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. str = getenv("LIBPFM_DISABLED_PMUS"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c:408:12: [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,"he:m:ic:o:j:b")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/evt2raw.c:53:13: [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, "hv")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c:494:12: [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 ((c=getopt_long(argc, argv,"+vhVd:", rtop_cmd_options, 0)) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:104:3: [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(getpid()); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:105:17: [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. options.cpu = random() % sysconf(_SC_NPROCESSORS_ONLN); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:239:12: [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,"he:c:d:")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:387:12: [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 ((i=getopt(argc, argv, "t:p:s:fhn:")) != EOF) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst.c:183:12: [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,"hc:e:d:gx")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:410:12: [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,"hc:e:d:xPpG:")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:390:12: [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 ((c=getopt_long(argc, argv,"hPe:m:c:d:G:", the_options, 0)) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:429:17: [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. options.cpu = random() % sysconf(_SC_NPROCESSORS_ONLN); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c:351:12: [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,"+he:ifpPt:")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c:162:12: [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,"he:vd:pgP")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c:378:12: [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,"+he:ifpPt:")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c:365:12: [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 ((c=getopt_long(argc, argv,"+he:m:ic:o:Mb", the_options, 0)) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/x86/bts_smpl.c:274:12: [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 ((c=getopt_long(argc, argv,"+hm:p:if", the_options, 0)) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/tests/validate.c:314:12: [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,"hpcaA")) != -1) { data/libpfm4-4.11.1+git4-gfa84c27/examples/check_events.c:53: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. const char *arg[3]; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:65: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. static const char *srcs[PFM_ATTR_CTRL_MAX]={ data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:196: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 buf[MAXBUF]; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:295: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 buf[MAXBUF]; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:802: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. static char *argv_all[2] = { ".*", NULL }; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:805: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 default_sep[2] = "\t"; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:842: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). options.combo_lim = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:319: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 buffer[128]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_perf_event.c:37: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 filename[PATH_MAX]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64_perf_event.c:46: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(filename, "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm.c:74: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/cpuinfo", "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm.c:154: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 buffer[128]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_cell.c:91: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 buffer[128]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1192: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 yes[2] = "y"; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:2029: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(uinfo, &info, sz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:2162: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(uinfo, &info, sz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:2225: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(&arg, uarg, sz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:2276: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(uarg, &arg, sz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:131: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). start = atoi(range); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:138:10: [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). end = atoi(range); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:160: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 buffer[64]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:163: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/pal/cpu0/perfmon_info", "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:176: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). pfm_gen_ia64_counter_width = atoi(p+2); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:181: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). pfm_gen_ia64_counters = atoi(p+2); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:186:45: [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). generic_pe[0].pme_entry_code.pme_vcode = atoi(p+2); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:191:45: [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). generic_pe[1].pme_entry_code.pme_vcode = atoi(p+2); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm_unc.c:95: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 umask_str[PFMLIB_EVT_MAX_NAME_LEN]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:375: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 umask_str[PFMLIB_EVT_MAX_NAME_LEN]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_perf_event.c:39: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 filename[PATH_MAX]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc_perf_event.c:48: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(filename, "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:136: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 buffer[64]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_perf_event.c:38: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 filename[PATH_MAX]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_perf_event.c:47: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(filename, "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_perf_event.c:349: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 file[64]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips.c:75: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/cpuinfo", "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips.c:136: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 buffer[1024]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips_priv.h:80: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 model[1024]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event.c:99: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(&arg, uarg, sz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event.c:123: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(attr, uarg->attr, asz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event.c:285: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(uarg->attr, attr, asz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event.c:295: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(uarg, &arg, sz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event.c:341: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(uarg, &arg, sz); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:114: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 debugfs_mnt[MAXPATHLEN]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:184: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/mounts", "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:238: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(addr, perf_static_events, perf_nevents * sizeof(perf_event_t)); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:322: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 d2path[MAXPATHLEN]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:323: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 idpath[MAXPATHLEN]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:324: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 id_str[32]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:417: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). fd = open(idpath, O_RDONLY); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_powerpc_perf_event.c:60: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[PATH_MAX]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_powerpc_perf_event.c:69:10: [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(filename, "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_priv.h:120: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 fstr[PFMLIB_EVT_MAX_NAME_LEN]; /* fully qualified event string */ data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:73: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(SYS_INFO, "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:112: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(SERVICE_LEVEL, "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:220: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(cpumcf_pe, cfvn_set, sizeof(*cpumcf_pe) * cfvn_set_count); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:222: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((void *) (cpumcf_pe + pme_count), csvn_set, data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:226: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((void *) (cpumcf_pe + pme_count), data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_perf_event.c:59: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(CPUM_CF_DEVICE_TYPE, "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:72: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 tmp[1024]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:73:7: [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(tmp,"/sys/kernel/perfmon/pmu_desc/pmd%d",i); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:79: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 tmp[1024]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:80:7: [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(tmp,"/sys/kernel/perfmon/pmu_desc/pmc%d",i); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:149: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. static char mips_name[64] = ""; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:151: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 buffer[128]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:164:6: [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(sicortex_support.pmu_name,"MIPSICE9A"), data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:172:6: [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(sicortex_support.pmu_name,"MIPSICE9B"), data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c:73: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/cpuinfo", "r"); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c:141: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 buffer[32]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_tx2_unc_perf_event.c:45: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 filename[PATH_MAX]; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_tx2_unc_perf_event.c:54: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(filename, "r"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c:422: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). options.mmap_pages = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c:435: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). options.cpu = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c:438:27: [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). options.output_file = fopen(optarg,"w"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/evt2raw.c:47: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 modifiers[MAX_MODIFIER_CHARS]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/perf_util.c:237: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(buf, (void*)(((uintptr_t)data)+tail), m); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/perf_util.c:243: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((void*)(((uintptr_t)buf)+m), data, sz - m); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/perf_util.c:362: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 buf[512]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c:160: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 buffer[128], *p, *value; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c:164: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). fp1 = fopen("/proc/cpuinfo", "r"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c:510: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). options.opt_delay = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:245: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). options.cpu = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:248: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). options.delay = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:393: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). program_time = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:396: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). threshold = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:399: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). signum = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:405: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). max_thr = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst.c:192: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). options.cpu = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst.c:198: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). options.delay = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:49: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. const char *events[MAX_GROUPS]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:67: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 mountpoint[MAX_PATH+1], tokens[MAX_PATH+1], type[MAX_PATH+1]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:71: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/mounts", "r"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:113: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 path[MAX_PATH+1]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:114: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 mnt[MAX_PATH+1]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:129: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). cfd = open(path, O_RDONLY); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:427: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). options.cpu = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:430: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). options.delay = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:233: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 mountpoint[MAX_PATH+1], tokens[MAX_PATH+1], type[MAX_PATH+1]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:237: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/mounts", "r"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:279: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 path[MAX_PATH+1]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:280: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 mnt[MAX_PATH+1]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:295: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). cfd = open(path, O_RDONLY); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:401: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). options.mmap_pages = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:407: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). options.delay = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:413: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). options.cpu = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c:41: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. const char *events[MAX_GROUPS]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c:374: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). options.pid = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c:99: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 fn[32]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c:126:2: [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(fn, "/proc/%d/status", pid); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c:177: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). options.delay = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c:195: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). return measure(atoi(argv[optind])); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c:43: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. const char *events[MAX_GROUPS]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c:401: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). options.pid = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c:379: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). options.mmap_pages = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c:388: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). options.cpu = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c:391:25: [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). options.output_file=fopen(optarg,"w"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/x86/bts_smpl.c:283: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). options.mmap_pages = atoi(optarg); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:78:8: [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(var) + 1 + strlen(value) + 1; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:78: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). len = strlen(var) + 1 + strlen(value) + 1; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:259:21: [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 (len < (1 + strlen(ainfo[j].name))) { data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:263:6: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(buf, ":", len-1);buf[len-1] = '\0'; len--; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:264:6: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, ainfo[j].name, len-1);buf[len-1] = '\0'; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:265: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). len -= strlen(ainfo[j].name); data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:560: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). len = strlen(info.name) + strlen(pinfo.name) + 1 + 2; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:560: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). len = strlen(info.name) + strlen(pinfo.name) + 1 + 2; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:635: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). len = strlen(info.name) + strlen(pinfo.name) + 1 + 2; data/libpfm4-4.11.1+git4-gfa84c27/examples/showevtinfo.c:635: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). len = strlen(info.name) + strlen(pinfo.name) + 1 + 2; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:325:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&buffer[0], (char *)(&b), 4); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:326:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&buffer[4], (char *)(&d), 4); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:327:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&buffer[8], (char *)(&c), 4); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:365:84: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). amd64_add_defaults(void *this, pfmlib_event_desc_t *e, unsigned int msk, uint64_t *umask) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:400:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). *umask |= ent->umasks[idx].ucode; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:484:4: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask |= pe[e->event].umasks[a->idx].ucode; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:555:47: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). ret = amd64_add_defaults(this, e, ugrpmsk, &umask); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_amd64.c:560:22: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). reg.sel_unit_mask = umask; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm.c:72: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). attr_len = strlen(attr); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm.c:95: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). value[strlen(value)-1] = '\0'; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_arm.c:100:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ret_buf, value, maxlen-1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:640:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != EOF) { data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:681:8: [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(str); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:682: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). todo = max - strlen(str); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:919: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). *fstr = malloc(strlen(e->fstr) + 2 + strlen(e->pmu->name) + 1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:919: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). *fstr = malloc(strlen(e->fstr) + 2 + strlen(e->pmu->name) + 1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:955:7: [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). l = strlen(pfm_cfg.forced_pmu); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1312: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(s)) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1323: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(s) > 1) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1518: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). s = p + strlen(PFMLIB_PMU_DELIM); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1792: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). len = strlen(einfo.name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1804: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). len = strlen(einfo.name) + strlen(ainfo.name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1804: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). len = strlen(einfo.name) + strlen(ainfo.name); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_common.c:1810:12: [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). maxlen += strlen(pmu->name) + 2 + 1 + 1; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:120:12: [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 (range[strlen(range)-1] == '\n') data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_gen_ia64.c:121: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). range[strlen(range)-1] = '\0'; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm_unc.c:90:11: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). uint64_t umask; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm_unc.c:155:4: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask |= pe[e->event].umasks[a->idx].ucode >> 8; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm_unc.c:158:15: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). reg.val |= umask << 8; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm_unc.c:215:55: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). ret = pfm_intel_x86_add_defaults(this, e, ugrpmsk, &umask, -1, -1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_nhm_unc.c:237:13: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). reg.val |= umask << 8; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:247:70: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). set_filters(void *this, pfm_snbep_unc_reg_t *filters, int event, int umask) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:251:37: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). filters[0].val |= pe[event].umasks[umask].ufilters[0] & ((1ULL << 32)-1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:252:39: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). filters[0].val &= ~(pe[event].umasks[umask].ufilters[0] >> 32); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:254:37: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). filters[1].val |= pe[event].umasks[umask].ufilters[1] & ((1ULL << 32)-1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:255:39: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). filters[1].val &= ~(pe[event].umasks[umask].ufilters[1] >>32); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:261:17: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). uint64_t *umask, data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:316:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). *umask |= ent->umasks[idx].ucode >> 8; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_snbep_unc.c:343:86: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). DPRINT("max_grpid=%d nattrs=%d k=%d umask=0x%"PRIx64"\n", max_grpid, e->nattrs, k, *umask); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:142:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&buffer[0], (char *)(&b), 4); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:143:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&buffer[4], (char *)(&d), 4); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:144:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&buffer[8], (char *)(&c), 4); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:191:17: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). uint64_t *umask, data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:255:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). *umask |= ent->umasks[idx].ucode >> 8; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:279:86: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). DPRINT("max_grpid=%d nattrs=%d k=%d umask=0x%"PRIx64"\n", max_grpid, e->nattrs, k, *umask); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:886:21: [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 (pe[i].desc && strlen(pe[i].desc) == 0) { data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86.c:949: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). if (pe[i].umasks[j].udesc && strlen(pe[i].umasks[j].udesc) == 0) { data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_intel_x86_priv.h:367:103: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). extern int pfm_intel_x86_add_defaults(void *this, pfmlib_event_desc_t *e, unsigned int msk, uint64_t *umask, unsigned short max_grpid, int excl_grp_but_0); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium.c:1116:56: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). pfm_ita_get_event_umask(unsigned int i, unsigned long *umask) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:132:27: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). unsigned long ref_umask, umask; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:165:8: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). if (umask && ref_umask != umask) return PFMLIB_ERR_NOASSIGN; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:165:30: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). if (umask && ref_umask != umask) return PFMLIB_ERR_NOASSIGN; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:234:16: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). unsigned long umask, mask; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:243:56: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). pfm_ita2_get_event_umask(inp->pfp_events[i].event, &umask); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:244:11: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). switch(umask) { data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:302:32: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). unsigned long pmc4_umask = 0, umask; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:401:137: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). DPRINT("pmc4_evt=%d pmc4_umask=0x%lx cnt_list[%d]=%d grp=%d umask=0x%lx\n", pmc4_evt, pmc4_umask, i, e[i].event,evt_grp(e[i].event), umask); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:403:77: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). if (as[i] != 4 && evt_grp(e[i].event) == PFMLIB_ITA2_EVT_L2_CACHE_GRP && umask != 0 && umask != pmc4_umask) break; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:403:91: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). if (as[i] != 4 && evt_grp(e[i].event) == PFMLIB_ITA2_EVT_L2_CACHE_GRP && umask != 0 && umask != pmc4_umask) break; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_itanium2.c:1999:57: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). pfm_ita2_get_event_umask(unsigned int i, unsigned long *umask) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips.c:73: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). attr_len = strlen(attr); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips.c:96: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). value[strlen(value)-1] = '\0'; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_mips.c:101:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ret_buf, value, maxlen-1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_montecito.c:347:16: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). unsigned long umask, mask; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_montecito.c:356:56: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). pfm_mont_get_event_umask(inp->pfp_events[i].event, &umask); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_montecito.c:357:11: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). switch(umask) { data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_montecito.c:2249:57: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). pfm_mont_get_event_umask(unsigned int i, unsigned long *umask) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:206:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(debugfs_mnt, mnt, MAXPATHLEN); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:422:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). err = read(fd, id_str, sizeof(id_str)); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:537:75: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). pfm_perf_add_defaults(pfmlib_event_desc_t *e, unsigned int msk, uint64_t *umask) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:567:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). *umask |= um->uid; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:660:43: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). ret = pfm_perf_add_defaults(e, grpmsk, &umask); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_perf_event_pmu.c:663:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). e->codes[0] |= umask; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_priv.h:760: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). return !a || !a->name || strlen(a->name) == 0 ? 1 : 0; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:90: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). len = strlen(tmp); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:123: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(CF_VERSION_STR, buffer, strlen(CF_VERSION_STR))) { data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_s390x_cpumf.c:124: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). rc = sscanf(buffer + strlen(CF_VERSION_STR), "%u.%u", data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sicortex.c:510:61: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). pfm_sicortex_get_event_umask(unsigned int i, unsigned long *umask) data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c:71: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). attr_len = strlen(attr); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c:94: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). value[strlen(value)-1] = '\0'; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c:99:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ret_buf, value, maxlen-1); data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c:157:14: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). reg.config.umask, data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc.c:184:15: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). reg.config.umask |= 1 << pe[e->event].umasks[a->idx].ubit; data/libpfm4-4.11.1+git4-gfa84c27/lib/pfmlib_sparc_priv.h:28:16: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). unsigned int umask : 8; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c:170:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(go[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/branch_smpl.c:178:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(ready[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/evt2raw.c:84:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(modifiers, ":"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/evt2raw.c:86:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(modifiers, "u"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/evt2raw.c:88:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(modifiers, "k"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/evt2raw.c:90:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(modifiers, "h"); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/notify_self.c:199:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[0].fd, val, sz); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c:189: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). value[strlen(value)-1] = '\0'; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/rtop.c:341:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(cpus[i].fd[0], raw_values, sizeof(raw_values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self.c:84:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[i].fd, values, sizeof(values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_basic.c:124:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, values, sizeof(values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_count.c:146:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds->fd, values, sizeof(values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:75:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fr, &c, 1); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:175:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(pw[0], &cc, 1); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_pipe.c:186:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[i].fd, values, sizeof(values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:118:6: [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. long mismatch[MAX_THR]; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:237:3: [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. mismatch[myid]++; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:419:3: [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. mismatch[i] = 0; data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/self_smpl_multi.c:487:40: [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. fd2ov[i].id, fd2ov[i].fd, total[i], mismatch[i], data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst.c:133:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[i].fd, fds[i].values, sizeof(fds[i].values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:103:6: [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(mountpoint) < maxlen) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_count.c:254:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[j].fd, fds[j].values, sizeof(fds[j].values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/syst_smpl.c:269:6: [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(mountpoint) < maxlen) { data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c:103:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[evt].fd, values, new_sz); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c:235:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(go[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task.c:245:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(ready[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_attach_timeout.c:66:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[i].fd, fds[i].values, sizeof(fds[i].values)); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c:106:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[evt].fd, values, new_sz); data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c:242:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(go[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_cpu.c:252:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(ready[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c:184:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(go[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/task_smpl.c:192:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(ready[0], &buf, 1) == -1) data/libpfm4-4.11.1+git4-gfa84c27/perf_examples/x86/bts_smpl.c:205:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fds[0].fd, val, sizeof(val)); data/libpfm4-4.11.1+git4-gfa84c27/tests/validate.c:51:8: [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(var) + 1 + strlen(value) + 1; data/libpfm4-4.11.1+git4-gfa84c27/tests/validate.c:51: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). len = strlen(var) + 1 + strlen(value) + 1; ANALYSIS SUMMARY: Hits = 313 Lines analyzed = 189188 in approximately 6.46 seconds (29300 lines/second) Physical Source Lines of Code (SLOC) = 170430 Hits@level = [0] 351 [1] 129 [2] 116 [3] 24 [4] 43 [5] 1 Hits@level+ = [0+] 664 [1+] 313 [2+] 184 [3+] 68 [4+] 44 [5+] 1 Hits/KSLOC@level+ = [0+] 3.89603 [1+] 1.83653 [2+] 1.07962 [3+] 0.398991 [4+] 0.258171 [5+] 0.00586751 Dot directories skipped = 1 (--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.