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/bottlerocket-0.05b3/br_cmd.c
Examining data/bottlerocket-0.05b3/br_cmd.h
Examining data/bottlerocket-0.05b3/br_translate.h
Examining data/bottlerocket-0.05b3/br_cmd_engine.c
Examining data/bottlerocket-0.05b3/br_cmd_engine.h
Examining data/bottlerocket-0.05b3/br.h
Examining data/bottlerocket-0.05b3/br.c

FINAL RESULTS:

data/bottlerocket-0.05b3/br.c:555:21:  [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 ((tmp_port = getenv("X10_PORTNAME"))) {
data/bottlerocket-0.05b3/br.c:566:19:  [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 ((opt = getopt_long(argc, argv, OPT_STRING, long_options,
data/bottlerocket-0.05b3/br.c:570: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 ((opt = getopt(argc, argv, OPT_STRING)) != -1) {
data/bottlerocket-0.05b3/br.c:297:18:  [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).
    while ((fd = open("/dev/null", 0, 0)) < 3)
data/bottlerocket-0.05b3/br.c:308: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(port, O_RDONLY | O_NONBLOCK)) < 0) {
data/bottlerocket-0.05b3/br.c:580:26:  [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).
                repeat = atoi(optarg);
data/bottlerocket-0.05b3/br_cmd.c:259: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.
    unsigned char cmd_seq[5] = { 0xd5, 0xaa, 0x00, 0x00, 0xad };
data/bottlerocket-0.05b3/br.c:350: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).
    if (strlen(arg) < 2) {

ANALYSIS SUMMARY:

Hits = 8
Lines analyzed = 2152 in approximately 0.10 seconds (22019 lines/second)
Physical Source Lines of Code (SLOC) = 1369
Hits@level = [0]  80 [1]   1 [2]   4 [3]   3 [4]   0 [5]   0
Hits@level+ = [0+]  88 [1+]   8 [2+]   7 [3+]   3 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 64.2805 [1+] 5.84368 [2+] 5.11322 [3+] 2.19138 [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.