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/nss-updatedb-10/cache.c
Examining data/nss-updatedb-10/cache.h
Examining data/nss-updatedb-10/main.c
Examining data/nss-updatedb-10/updatedb.c
Examining data/nss-updatedb-10/updatedb.h

FINAL RESULTS:

data/nss-updatedb-10/cache.c:65:6:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
	if (mktemp(cache->tmpfilename) == NULL) {
data/nss-updatedb-10/cache.h:17:13:  [4] (shell) system:
  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.
#error This system does not appear to support the GNU NSS interface.
data/nss-updatedb-10/updatedb.c:24:13:  [4] (shell) system:
  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.
#error This system does not appear to support the dlfcn interface.
data/nss-updatedb-10/updatedb.h:17:13:  [4] (shell) system:
  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.
#error This system does not appear to support the GNU NSS interface.
data/nss-updatedb-10/cache.c:80: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).
	rc = cache->db->open(cache->db, NULL,
data/nss-updatedb-10/cache.c:96: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).
	rc = cache->db->open(cache->db, cache->tmpfilename, NULL,
data/nss-updatedb-10/cache.c:180:2:  [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[1024], *buf2 = NULL;
data/nss-updatedb-10/cache.c:194:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(&s[1], name, len);
data/nss-updatedb-10/cache.c:209:2:  [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[32];
data/nss-updatedb-10/cache.c:220:2:  [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[32];
data/nss-updatedb-10/cache.c:237:2:  [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 pwbuf[1024];
data/nss-updatedb-10/cache.c:280:2:  [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 grbuf[1024], *grbuf2 = NULL;
data/nss-updatedb-10/cache.c:285:2:  [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 gidbuf[32];
data/nss-updatedb-10/updatedb.c:45:2:  [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 libpath[PATH_MAX];
data/nss-updatedb-10/updatedb.c:84:2:  [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 function[128];
data/nss-updatedb-10/cache.c:135:16:  [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).
	db_key.size = strlen(key);
data/nss-updatedb-10/cache.c:139:16:  [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).
	db_val.size = strlen(value) + 1;
data/nss-updatedb-10/cache.c:183:8:  [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).
	len = strlen(name);
data/nss-updatedb-10/cache.c:293:8:  [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).
	len = strlen(gr->gr_name) + 1 /* : */;
data/nss-updatedb-10/cache.c:294:36:  [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).
	len += ((gr->gr_passwd != NULL) ? strlen(gr->gr_passwd) : 1) + 1 /* : */;
data/nss-updatedb-10/cache.c:295: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).
	len += strlen(gidbuf) + 1 /* : */;
data/nss-updatedb-10/cache.c:301:11:  [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).
			len += strlen(*grmem_p);

ANALYSIS SUMMARY:

Hits = 22
Lines analyzed = 912 in approximately 0.04 seconds (22062 lines/second)
Physical Source Lines of Code (SLOC) = 705
Hits@level = [0]  28 [1]   7 [2]  11 [3]   0 [4]   4 [5]   0
Hits@level+ = [0+]  50 [1+]  22 [2+]  15 [3+]   4 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 70.922 [1+] 31.2057 [2+] 21.2766 [3+] 5.67376 [4+] 5.67376 [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.