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/beep-1.4.9/beep-compiler.h
Examining data/beep-1.4.9/beep-driver-console.c
Examining data/beep-1.4.9/beep-driver-evdev.c
Examining data/beep-1.4.9/beep-driver-noop.c
Examining data/beep-1.4.9/beep-driver.h
Examining data/beep-1.4.9/beep-drivers.c
Examining data/beep-1.4.9/beep-drivers.h
Examining data/beep-1.4.9/beep-library.c
Examining data/beep-1.4.9/beep-library.h
Examining data/beep-1.4.9/beep-log.c
Examining data/beep-1.4.9/beep-log.h
Examining data/beep-1.4.9/beep-main.c
Examining data/beep-1.4.9/beep-types.h
Examining data/beep-1.4.9/beep-usage.h
Examining data/beep-1.4.9/issue-6-benchmark.c

FINAL RESULTS:

data/beep-1.4.9/beep-log.c:58:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, format, copied_args);
data/beep-1.4.9/beep-log.c:71:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stdout, format, args);
data/beep-1.4.9/beep-log.h:53:28:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    __attribute__(( format(printf, 1, 2) ));
data/beep-1.4.9/beep-log.h:59:28:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    __attribute__(( format(printf, 1, 2) ));
data/beep-1.4.9/beep-log.h:65:28:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    __attribute__(( format(printf, 1, 2) ));
data/beep-1.4.9/beep-log.h:71:28:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    __attribute__(( format(printf, 1, 2) ));
data/beep-1.4.9/issue-6-benchmark.c:462:9:  [4] (shell) execv:
  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.
        execv("/usr/bin/time", argv);
data/beep-1.4.9/beep-main.c:241:18:  [3] (buffer) getopt_long:
  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 ((ch = getopt_long(argc, argv, "f:l:r:d:D:schvVne:", opt_list, NULL))
data/beep-1.4.9/beep-main.c:483:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They 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 (getenv("SUDO_COMMAND") || getenv("SUDO_USER") ||
data/beep-1.4.9/beep-main.c:483:39:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They 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 (getenv("SUDO_COMMAND") || getenv("SUDO_USER") ||
data/beep-1.4.9/beep-main.c:484:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They 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.
            getenv("SUDO_UID") || getenv("SUDO_GID")) {
data/beep-1.4.9/beep-main.c:484:35:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They 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.
            getenv("SUDO_UID") || getenv("SUDO_GID")) {
data/beep-1.4.9/beep-library.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).
    const int fd = open(device_name, O_WRONLY);
data/beep-1.4.9/beep-library.c:89:5:  [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.
    char strerr_buf[128];
data/beep-1.4.9/beep-log.c:120:5:  [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.
    char linebuf[80] =
data/beep-1.4.9/beep-main.c:576:13:  [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.
            char sin[4096];
data/beep-1.4.9/issue-6-benchmark.c:218:24:  [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).
        const int fd = open(device, O_WRONLY);
data/beep-1.4.9/issue-6-benchmark.c:454:9:  [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.
        char repeat_buf[20];
data/beep-1.4.9/issue-6-benchmark.c:458:9:  [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.
        char *argv[10] = { "/usr/bin/time", "-v",
data/beep-1.4.9/issue-6-benchmark.c:682:28:  [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).
            const int fd = open(ttydev_name, O_WRONLY);
data/beep-1.4.9/issue-6-benchmark.c:773:26:  [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).
    const int ret_open = open(console_device, O_WRONLY);
data/beep-1.4.9/beep-library.c:93: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).
                  0+0+0+0+strlen("strerror_r error\n"))) {
data/beep-1.4.9/beep-library.c:98: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).
    const size_t msglen = strlen(msg);
data/beep-1.4.9/beep-library.c:105: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).
    const size_t errlen = strlen(strerr_buf);
data/beep-1.4.9/issue-6-benchmark.c:665:43:  [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).
            const size_t ttydev_name_sz = strlen("/dev/") + strlen(de->d_name) + 1 + 1;
data/beep-1.4.9/issue-6-benchmark.c:665:61:  [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).
            const size_t ttydev_name_sz = strlen("/dev/") + strlen(de->d_name) + 1 + 1;

ANALYSIS SUMMARY:

Hits = 26
Lines analyzed = 3015 in approximately 0.09 seconds (32562 lines/second)
Physical Source Lines of Code (SLOC) = 1488
Hits@level = [0]  45 [1]   5 [2]   9 [3]   5 [4]   7 [5]   0
Hits@level+ = [0+]  71 [1+]  26 [2+]  21 [3+]  12 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 47.7151 [1+] 17.4731 [2+] 14.1129 [3+] 8.06452 [4+] 4.7043 [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.