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/nailgun-0.9.3/nailgun-client/ng.c

FINAL RESULTS:

data/nailgun-0.9.3/nailgun-client/ng.c:833:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(isattybuf, NAILGUN_TTY_FORMAT, i, isatty(i));
data/nailgun-0.9.3/nailgun-client/ng.c:683:20:  [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.
  nailgun_server = getenv("NAILGUN_SERVER");
data/nailgun-0.9.3/nailgun-client/ng.c:689:18:  [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.
  nailgun_port = getenv("NAILGUN_PORT");
data/nailgun-0.9.3/nailgun-client/ng.c:123:1:  [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 buf[BUFSIZE];
data/nailgun-0.9.3/nailgun-client/ng.c:228:3:  [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 header[CHUNK_HEADER_LEN];
data/nailgun-0.9.3/nailgun-client/ng.c:269:12:  [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 ((f = open(filename, O_RDONLY)) < 0) {
data/nailgun-0.9.3/nailgun-client/ng.c:380:14:  [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).
  exitcode = atoi(buf);
data/nailgun-0.9.3/nailgun-client/ng.c:435:3:  [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 wbuf[BUFSIZE];
data/nailgun-0.9.3/nailgun-client/ng.c:787:14:  [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).
      port = atoi(nailgun_port);
data/nailgun-0.9.3/nailgun-client/ng.c:274:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  i = read(f, buf, BUFSIZE);
data/nailgun-0.9.3/nailgun-client/ng.c:277:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    i = read(f, buf, BUFSIZE);
data/nailgun-0.9.3/nailgun-client/ng.c:296:20:  [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).
  int len = text ? strlen(text) : 0;
data/nailgun-0.9.3/nailgun-client/ng.c:473:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int bytesread = read(STDIN_FILENO, buf, BUFSIZE);
data/nailgun-0.9.3/nailgun-client/ng.c:757: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).
      size_t socket_path_len = strlen(socket_path);
data/nailgun-0.9.3/nailgun-client/ng.c:768:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(server_addr_un.sun_path, socket_path, socket_path_len);

ANALYSIS SUMMARY:

Hits = 15
Lines analyzed = 898 in approximately 0.05 seconds (19185 lines/second)
Physical Source Lines of Code (SLOC) = 581
Hits@level = [0]  31 [1]   6 [2]   6 [3]   2 [4]   1 [5]   0
Hits@level+ = [0+]  46 [1+]  15 [2+]   9 [3+]   3 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 79.1738 [1+] 25.8176 [2+] 15.4905 [3+] 5.16351 [4+] 1.72117 [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.