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/klick-0.12.2/src/osc_handler.cc
Examining data/klick-0.12.2/src/metronome_simple.cc
Examining data/klick-0.12.2/src/metronome.cc
Examining data/klick-0.12.2/src/audio_interface_jack.cc
Examining data/klick-0.12.2/src/terminal_handler.cc
Examining data/klick-0.12.2/src/metronome_map.cc
Examining data/klick-0.12.2/src/util/util.cc
Examining data/klick-0.12.2/src/audio_interface_sndfile.cc
Examining data/klick-0.12.2/src/klick.cc
Examining data/klick-0.12.2/src/options.cc
Examining data/klick-0.12.2/src/main.cc
Examining data/klick-0.12.2/src/metronome_jack.cc
Examining data/klick-0.12.2/src/position.cc
Examining data/klick-0.12.2/src/audio_chunk.cc
Examining data/klick-0.12.2/src/audio_interface.cc
Examining data/klick-0.12.2/src/osc_interface.cc
Examining data/klick-0.12.2/src/tempomap.cc

FINAL RESULTS:

data/klick-0.12.2/src/options.cc:117:19:  [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, optstring)) != -1) {
data/klick-0.12.2/src/main.cc:30:7:  [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).
    f.open(path.c_str(), std::ios::in);
data/klick-0.12.2/src/tempomap.cc:46:18:  [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 len ? atoi(std::string(s.c_str() + m.rm_so, len).c_str()) : 0;
data/klick-0.12.2/src/klick.cc:397:11:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        ::usleep(static_cast<unsigned long>(_options->delay * 1000000));
data/klick-0.12.2/src/klick.cc:413:11:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        ::usleep(10000);
data/klick-0.12.2/src/terminal_handler.cc:80:17:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return std::fgetc(stdin);
data/klick-0.12.2/src/terminal_handler.cc:87:22:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        int k = std::fgetc(stdin);

ANALYSIS SUMMARY:

Hits = 7
Lines analyzed = 3563 in approximately 0.41 seconds (8767 lines/second)
Physical Source Lines of Code (SLOC) = 2502
Hits@level = [0]   0 [1]   4 [2]   2 [3]   1 [4]   0 [5]   0
Hits@level+ = [0+]   7 [1+]   7 [2+]   3 [3+]   1 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 2.79776 [1+] 2.79776 [2+] 1.19904 [3+] 0.39968 [4+]   0 [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.