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/feedbackd-0.0.0+git20201114/cli/fbcli.c Examining data/feedbackd-0.0.0+git20201114/libfeedback/lfb-event.c Examining data/feedbackd-0.0.0+git20201114/libfeedback/lfb-event.h Examining data/feedbackd-0.0.0+git20201114/libfeedback/lfb-names.h Examining data/feedbackd-0.0.0+git20201114/libfeedback/lfb-priv.h Examining data/feedbackd-0.0.0+git20201114/libfeedback/libfeedback.c Examining data/feedbackd-0.0.0+git20201114/libfeedback/libfeedback.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-dev-leds.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-dev-leds.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-dev-sound.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-dev-sound.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-dev-vibra.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-dev-vibra.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-event.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-event.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-base.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-base.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-dummy.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-dummy.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-led.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-led.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-manager.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-manager.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-profile.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-profile.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-sound.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-sound.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-theme.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-theme.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-vibra-periodic.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-vibra-periodic.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-vibra-rumble.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-vibra-rumble.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-vibra.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-feedback-vibra.h Examining data/feedbackd-0.0.0+git20201114/src/fbd-ledctrl.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-udev.c Examining data/feedbackd-0.0.0+git20201114/src/fbd-udev.h Examining data/feedbackd-0.0.0+git20201114/src/fbd.c Examining data/feedbackd-0.0.0+git20201114/src/fbd.h Examining data/feedbackd-0.0.0+git20201114/tests/test-fbd-event.c Examining data/feedbackd-0.0.0+git20201114/tests/test-fbd-feedback-profile.c Examining data/feedbackd-0.0.0+git20201114/tests/test-fbd-feedback-theme.c Examining data/feedbackd-0.0.0+git20201114/tests/test-lfb-event.c Examining data/feedbackd-0.0.0+git20201114/tests/test-lfb-integration.c Examining data/feedbackd-0.0.0+git20201114/debian/tests/build-test.c FINAL RESULTS: data/feedbackd-0.0.0+git20201114/src/fbd-ledctrl.c:80:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(path, -1, gid) < 0) { data/feedbackd-0.0.0+git20201114/src/fbd-ledctrl.c:85:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(path, 0664) < 0) { data/feedbackd-0.0.0+git20201114/cli/fbcli.c:129:17: [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. main (int argc, char *argv[0]) data/feedbackd-0.0.0+git20201114/src/fbd-dev-vibra.c:108: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). self->fd = open (filename, O_RDWR | O_NONBLOCK, O_RDWR); data/feedbackd-0.0.0+git20201114/src/fbd-ledctrl.c:38:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (path, O_WRONLY|O_TRUNC, 0666); data/feedbackd-0.0.0+git20201114/src/fbd-udev.c:28:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (path, O_WRONLY|O_TRUNC, 0666); data/feedbackd-0.0.0+git20201114/src/fbd-udev.c:63:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open (path, O_WRONLY|O_TRUNC, 0666); data/feedbackd-0.0.0+git20201114/src/fbd-feedback-manager.c:263: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). if (!strlen (arg_app_id)) { data/feedbackd-0.0.0+git20201114/src/fbd-feedback-manager.c:270: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). if (!strlen (arg_event)) { data/feedbackd-0.0.0+git20201114/src/fbd-feedback-profile.c:96: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). type_name[strlen(FBD_FEEDBACK_CLS_PREFIX)] = data/feedbackd-0.0.0+git20201114/src/fbd-feedback-profile.c:97:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). g_ascii_toupper (type_name[strlen(FBD_FEEDBACK_CLS_PREFIX)]); data/feedbackd-0.0.0+git20201114/src/fbd-ledctrl.c:44: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 (val); data/feedbackd-0.0.0+git20201114/src/fbd-udev.c:35: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 (s); data/feedbackd-0.0.0+git20201114/src/fbd-udev.c:71: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 (s); ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 6514 in approximately 0.17 seconds (38069 lines/second) Physical Source Lines of Code (SLOC) = 4529 Hits@level = [0] 9 [1] 7 [2] 5 [3] 0 [4] 0 [5] 2 Hits@level+ = [0+] 23 [1+] 14 [2+] 7 [3+] 2 [4+] 2 [5+] 2 Hits/KSLOC@level+ = [0+] 5.07838 [1+] 3.09119 [2+] 1.5456 [3+] 0.441599 [4+] 0.441599 [5+] 0.441599 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.