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/sensors-applet-3.0.0+git6/lib/sensors-applet-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/acpi/acpi-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/acpi/acpi-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/aticonfig/aticonfig-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/aticonfig/aticonfig-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/eee/eee-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/eee/eee-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/hddtemp/hddtemp-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/hddtemp/hddtemp-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/i2c-proc/i2c-proc-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/i2c-proc/i2c-proc-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/i2c-sys/i2c-sys-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/i2c-sys/i2c-sys-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/i8k/i8k-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/i8k/i8k-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/ibm-acpi/ibm-acpi-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/ibm-acpi/ibm-acpi-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/libsensors/libsensors-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/libsensors/libsensors-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/mbmon/mbmon-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/mbmon/mbmon-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/nvidia/nvidia-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/nvidia/nvidia-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/omnibook/omnibook-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/omnibook/omnibook-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/pmu-sys/pmu-sys-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/pmu-sys/pmu-sys-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/smu-sys/smu-sys-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/smu-sys/smu-sys-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/sonypi/sonypi-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/sonypi/sonypi-plugin.h Examining data/sensors-applet-3.0.0+git6/plugins/udisks/udisks-plugin.c Examining data/sensors-applet-3.0.0+git6/plugins/udisks/udisks-plugin.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/about-dialog.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/about-dialog.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/active-sensor-libnotify.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/active-sensor-libnotify.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/active-sensor.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/prefs-dialog.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/prefs-dialog.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensor-config-dialog.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensor-config-dialog.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet-conf.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet-conf.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet-plugin.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet-plugins.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet-plugins.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet-sensor.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-module.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet.c Examining data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet.h Examining data/sensors-applet-3.0.0+git6/sensors-applet/active-sensor.c FINAL RESULTS: data/sensors-applet-3.0.0+git6/lib/sensors-applet-plugin.c:42:21: [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(path, R_OK) == 0) { data/sensors-applet-3.0.0+git6/plugins/aticonfig/aticonfig-plugin.c:54:21: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE *aticonfig = popen(ATICONFIG_EXE data/sensors-applet-3.0.0+git6/sensors-applet/sensors-applet-plugins.c:130:14: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. if ((home = g_get_home_dir()) != NULL) { data/sensors-applet-3.0.0+git6/plugins/acpi/acpi-plugin.c:102:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/eee/eee-plugin.c:87:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/i2c-proc/i2c-proc-plugin.c:153:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/i2c-sys/i2c-sys-plugin.c:157:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/i8k/i8k-plugin.c:92:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/ibm-acpi/ibm-acpi-plugin.c:150: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). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/libsensors/libsensors-plugin.c:262:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((file = fopen (LIBSENSORS_CONFIG_FILE, "r")) == NULL) { data/sensors-applet-3.0.0+git6/plugins/libsensors/libsensors-plugin.c:263:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((file = fopen (LIBSENSORS_ALTERNATIVE_CONFIG_FILE, "r")) == NULL) { data/sensors-applet-3.0.0+git6/plugins/libsensors/libsensors-plugin.c:457: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). feature = atoi(path + m[2].rm_so); data/sensors-applet-3.0.0+git6/plugins/omnibook/omnibook-plugin.c:76:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/pmu-sys/pmu-sys-plugin.c:140:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/smu-sys/smu-sys-plugin.c:134:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/sensors-applet-3.0.0+git6/plugins/sonypi/sonypi-plugin.c:57:20: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( (fd = open(SONYPI_DEV, O_RDONLY)) != -1 ) { data/sensors-applet-3.0.0+git6/plugins/sonypi/sonypi-plugin.c:81:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(path, O_RDONLY)) != -1) { data/sensors-applet-3.0.0+git6/sensors-applet/active-sensor.c:407:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(as->sensor_values, data/sensors-applet-3.0.0+git6/plugins/acpi/acpi-plugin.c:107:6: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (fscanf(fp, "temperature: %f %31s", &sensor_value, units) < 1) { data/sensors-applet-3.0.0+git6/plugins/aticonfig/aticonfig-plugin.c:61:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getc(aticonfig); data/sensors-applet-3.0.0+git6/plugins/aticonfig/aticonfig-plugin.c:127:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i = g_ascii_strtoll(id + strlen(SENSOR_ID_PREFIX), NULL, 10); data/sensors-applet-3.0.0+git6/plugins/hddtemp/hddtemp-plugin.c:104:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((n = read(sockfd, pc, data/sensors-applet-3.0.0+git6/plugins/i8k/i8k-plugin.c:104:7: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (fgetc(fp) == ' ') { data/sensors-applet-3.0.0+git6/plugins/mbmon/mbmon-plugin.c:96:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((n = read(sockfd, pc, MBMON_OUTPUT_BUFFER_LENGTH - output_length)) > 0) { data/sensors-applet-3.0.0+git6/plugins/nvidia/nvidia-plugin.c:52: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). i = g_ascii_strtoll(id + strlen("GPU"), NULL, 10); data/sensors-applet-3.0.0+git6/sensors-applet/active-sensor.c:83: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(active_sensor->alarm_command[notif_type])) { ANALYSIS SUMMARY: Hits = 26 Lines analyzed = 9515 in approximately 0.24 seconds (39901 lines/second) Physical Source Lines of Code (SLOC) = 6512 Hits@level = [0] 18 [1] 8 [2] 15 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 44 [1+] 26 [2+] 18 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 6.75676 [1+] 3.99263 [2+] 2.76413 [3+] 0.460688 [4+] 0.307125 [5+] 0 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.