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/ayatana-indicator-power-2.1.1/src/brightness.c
Examining data/ayatana-indicator-power-2.1.1/src/brightness.h
Examining data/ayatana-indicator-power-2.1.1/src/dbus-shared.h
Examining data/ayatana-indicator-power-2.1.1/src/device.c
Examining data/ayatana-indicator-power-2.1.1/src/device.h
Examining data/ayatana-indicator-power-2.1.1/src/device-provider.c
Examining data/ayatana-indicator-power-2.1.1/src/device-provider.h
Examining data/ayatana-indicator-power-2.1.1/src/device-provider-mock.c
Examining data/ayatana-indicator-power-2.1.1/src/device-provider-mock.h
Examining data/ayatana-indicator-power-2.1.1/src/device-provider-upower.c
Examining data/ayatana-indicator-power-2.1.1/src/device-provider-upower.h
Examining data/ayatana-indicator-power-2.1.1/src/flashlight.c
Examining data/ayatana-indicator-power-2.1.1/src/flashlight.h
Examining data/ayatana-indicator-power-2.1.1/src/main.c
Examining data/ayatana-indicator-power-2.1.1/src/notifier.c
Examining data/ayatana-indicator-power-2.1.1/src/notifier.h
Examining data/ayatana-indicator-power-2.1.1/src/service.c
Examining data/ayatana-indicator-power-2.1.1/src/service.h
Examining data/ayatana-indicator-power-2.1.1/src/testing.c
Examining data/ayatana-indicator-power-2.1.1/src/testing.h
Examining data/ayatana-indicator-power-2.1.1/src/utils.c
Examining data/ayatana-indicator-power-2.1.1/src/utils.h
Examining data/ayatana-indicator-power-2.1.1/tests/glib-fixture.h
Examining data/ayatana-indicator-power-2.1.1/tests/test-dbus-listener.cc
Examining data/ayatana-indicator-power-2.1.1/tests/test-device.cc
Examining data/ayatana-indicator-power-2.1.1/tests/test-notify.cc
Examining data/ayatana-indicator-power-2.1.1/tests/test-service.cc

FINAL RESULTS:

data/ayatana-indicator-power-2.1.1/src/flashlight.c:46:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access(qcom_sysfs[i], F_OK ) != -1){
data/ayatana-indicator-power-2.1.1/src/flashlight.c:78:20:  [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.
    needs_enable = access(qcom_torch_enable, F_OK ) != -1;
data/ayatana-indicator-power-2.1.1/src/flashlight.c:85:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        fprintf(fd1, QCOM_DISABLE);
data/ayatana-indicator-power-2.1.1/src/flashlight.c:87:7:  [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(fd1, QCOM_ENABLE);
data/ayatana-indicator-power-2.1.1/src/flashlight.c:76:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fd1 = fopen(flash_sysfs_path, "w");
data/ayatana-indicator-power-2.1.1/src/flashlight.c:80:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      fd2 = fopen(qcom_torch_enable, "w");
data/ayatana-indicator-power-2.1.1/src/service.c:73: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 * const menu_names[N_PROFILES] =
data/ayatana-indicator-power-2.1.1/tests/test-device.cc:829: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).
    const time_t time = atoi(tokens[2]);
data/ayatana-indicator-power-2.1.1/tests/test-device.cc:832:35:  [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).
    const gboolean power_supply = atoi(tokens[5]);

ANALYSIS SUMMARY:

Hits = 9
Lines analyzed = 8001 in approximately 0.19 seconds (43021 lines/second)
Physical Source Lines of Code (SLOC) = 5516
Hits@level = [0]   2 [1]   0 [2]   5 [3]   0 [4]   4 [5]   0
Hits@level+ = [0+]  11 [1+]   9 [2+]   9 [3+]   4 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 1.9942 [1+] 1.63162 [2+] 1.63162 [3+] 0.725163 [4+] 0.725163 [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.