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/mate-sensors-applet-1.24.1/lib/sensors-applet-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/acpi/acpi-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/acpi/acpi-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/aticonfig/aticonfig-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/aticonfig/aticonfig-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/dummy/dummy-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/dummy/dummy-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/hddtemp/hddtemp-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/hddtemp/hddtemp-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/i2c-proc/i2c-proc-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/i2c-proc/i2c-proc-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/i2c-sys/i2c-sys-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/i2c-sys/i2c-sys-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/i8k/i8k-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/i8k/i8k-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/ibm-acpi/ibm-acpi-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/ibm-acpi/ibm-acpi-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/libsensors/libsensors-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/libsensors/libsensors-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/mbmon/mbmon-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/mbmon/mbmon-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/netbsd/netbsd-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/netbsd/netbsd-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/nvidia/nvidia-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/nvidia/nvidia-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/omnibook/omnibook-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/omnibook/omnibook-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/pmu-sys/pmu-sys-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/pmu-sys/pmu-sys-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/smu-sys/smu-sys-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/smu-sys/smu-sys-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/sonypi/sonypi-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/sonypi/sonypi-plugin.h Examining data/mate-sensors-applet-1.24.1/plugins/udisks2/udisks2-plugin.c Examining data/mate-sensors-applet-1.24.1/plugins/udisks2/udisks2-plugin.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/about-dialog.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/about-dialog.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/active-sensor-libnotify.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/active-sensor-libnotify.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/active-sensor.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/active-sensor.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/main.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/prefs-dialog.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/prefs-dialog.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensor-config-dialog.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensor-config-dialog.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-plugin.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-plugins.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-plugins.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-sensor.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-settings.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-settings.h Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet.c Examining data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet.h FINAL RESULTS: data/mate-sensors-applet-1.24.1/lib/sensors-applet-plugin.c:41:13: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path, R_OK) == 0) { data/mate-sensors-applet-1.24.1/plugins/aticonfig/aticonfig-plugin.c:56:23: [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/mate-sensors-applet-1.24.1/plugins/dummy/dummy-plugin.c:108:5: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-plugins.c:126:17: [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/mate-sensors-applet-1.24.1/plugins/acpi/acpi-plugin.c:94:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/i2c-proc/i2c-proc-plugin.c:151:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/i2c-sys/i2c-sys-plugin.c:159:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/i8k/i8k-plugin.c:94:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/ibm-acpi/ibm-acpi-plugin.c:153:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/libsensors/libsensors-plugin.c:82:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[BUF_SIZE]; data/mate-sensors-applet-1.24.1/plugins/libsensors/libsensors-plugin.c:241:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((file = fopen (LIBSENSORS_CONFIG_FILE, "r")) == NULL) { data/mate-sensors-applet-1.24.1/plugins/libsensors/libsensors-plugin.c:242:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((file = fopen (LIBSENSORS_ALTERNATIVE_CONFIG_FILE, "r")) == NULL) { data/mate-sensors-applet-1.24.1/plugins/libsensors/libsensors-plugin.c:410:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). feature = atoi(feature_str); data/mate-sensors-applet-1.24.1/plugins/netbsd/netbsd-plugin.c:117:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). sysmon_fd = open("/dev/sysmon", O_RDONLY); data/mate-sensors-applet-1.24.1/plugins/omnibook/omnibook-plugin.c:74:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/pmu-sys/pmu-sys-plugin.c:142:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/smu-sys/smu-sys-plugin.c:135:23: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (NULL == (fp = fopen(path, "r"))) { data/mate-sensors-applet-1.24.1/plugins/sonypi/sonypi-plugin.c:59:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ( (fd = open(SONYPI_DEV, O_RDONLY)) != -1 ) { data/mate-sensors-applet-1.24.1/plugins/sonypi/sonypi-plugin.c:84:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(path, O_RDONLY)) != -1) { data/mate-sensors-applet-1.24.1/sensors-applet/active-sensor.c:382:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(as->sensor_values, data/mate-sensors-applet-1.24.1/plugins/acpi/acpi-plugin.c:99:9: [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/mate-sensors-applet-1.24.1/plugins/aticonfig/aticonfig-plugin.c:63:13: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getc(aticonfig); data/mate-sensors-applet-1.24.1/plugins/aticonfig/aticonfig-plugin.c:131:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i = g_ascii_strtoll(id + strlen(SENSOR_ID_PREFIX), NULL, 10); data/mate-sensors-applet-1.24.1/plugins/hddtemp/hddtemp-plugin.c:102:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((n = read(sockfd, pc, sizeof(buffer) - output_length)) > 0) { data/mate-sensors-applet-1.24.1/plugins/i8k/i8k-plugin.c:106:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (fgetc(fp) == ' ') { data/mate-sensors-applet-1.24.1/plugins/mbmon/mbmon-plugin.c:97:21: [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/mate-sensors-applet-1.24.1/plugins/nvidia/nvidia-plugin.c:52: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). i = g_ascii_strtoll(id + strlen("GPU"), NULL, 10); data/mate-sensors-applet-1.24.1/sensors-applet/sensors-applet-settings.c:51:62: [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). g_checksum_update (checksum, (const guchar *) unique_id, strlen (unique_id)); ANALYSIS SUMMARY: Hits = 28 Lines analyzed = 9799 in approximately 0.32 seconds (31071 lines/second) Physical Source Lines of Code (SLOC) = 6404 Hits@level = [0] 45 [1] 8 [2] 16 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 73 [1+] 28 [2+] 20 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 11.3991 [1+] 4.37227 [2+] 3.12305 [3+] 0.62461 [4+] 0.312305 [5+] 0 Dot directories skipped = 3 (--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.