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/dnsproxy-1.16/daemon.c
Examining data/dnsproxy-1.16/dnsproxy.c
Examining data/dnsproxy-1.16/dnsproxy.h
Examining data/dnsproxy-1.16/hash.c
Examining data/dnsproxy-1.16/internal.c
Examining data/dnsproxy-1.16/log.c
Examining data/dnsproxy-1.16/parse.c
Examining data/dnsproxy-1.16/stats.c

FINAL RESULTS:

data/dnsproxy-1.16/dnsproxy.c:257:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
			fprintf(stderr, PACKAGE_STRING "\n");
data/dnsproxy-1.16/dnsproxy.h:51:25:  [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.
#define DPRINTF(x) do { printf x ; } while (0)
data/dnsproxy-1.16/log.c:46:9:  [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.
		(void)vfprintf(stderr, fmt, ap);
data/dnsproxy-1.16/dnsproxy.c:248:15:  [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 ((ch = getopt(argc, argv, "c:dhV")) != -1) {
data/dnsproxy-1.16/dnsproxy.c:331:27:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
		if (chdir(chrootdir) || chroot(chrootdir))
data/dnsproxy-1.16/daemon.c:59: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).
	if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
data/dnsproxy-1.16/dnsproxy.c:86: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[MAX_BUFSPACE];
data/dnsproxy-1.16/dnsproxy.c:123: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(&req->client, &fromaddr, sizeof(struct sockaddr_in));
data/dnsproxy-1.16/dnsproxy.c:124: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(&req->clientid, &buf[0], 2);
data/dnsproxy-1.16/dnsproxy.c:140: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(&buf[0], &req->id, 2);
data/dnsproxy-1.16/dnsproxy.c:189: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[MAX_BUFSPACE];
data/dnsproxy-1.16/dnsproxy.c:219: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(&buf[0], &query->clientid, 2);
data/dnsproxy-1.16/internal.c:63: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(&ipa->addr, &addr, 4);
data/dnsproxy-1.16/internal.c:82: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(&addr, &arg, 4);
data/dnsproxy-1.16/parse.c:38: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];
data/dnsproxy-1.16/parse.c:41:11:  [2] (misc) fopen:
  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 = fopen(fname, "r")) == NULL)

ANALYSIS SUMMARY:

Hits = 16
Lines analyzed = 999 in approximately 0.06 seconds (16569 lines/second)
Physical Source Lines of Code (SLOC) = 603
Hits@level = [0]   4 [1]   0 [2]  11 [3]   2 [4]   3 [5]   0
Hits@level+ = [0+]  20 [1+]  16 [2+]  16 [3+]   5 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 33.1675 [1+] 26.534 [2+] 26.534 [3+] 8.29187 [4+] 4.97512 [5+]   0
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.