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/llmnrd-0.5/compiler.h
Examining data/llmnrd-0.5/err.h
Examining data/llmnrd-0.5/iface.c
Examining data/llmnrd-0.5/iface.h
Examining data/llmnrd-0.5/list.h
Examining data/llmnrd-0.5/llmnr-packet.h
Examining data/llmnrd-0.5/llmnr-query.c
Examining data/llmnrd-0.5/llmnr.c
Examining data/llmnrd-0.5/llmnr.h
Examining data/llmnrd-0.5/llmnrd.c
Examining data/llmnrd-0.5/log.h
Examining data/llmnrd-0.5/pkt.h
Examining data/llmnrd-0.5/socket.c
Examining data/llmnrd-0.5/socket.h
Examining data/llmnrd-0.5/util.c
Examining data/llmnrd-0.5/util.h

FINAL RESULTS:

data/llmnrd-0.5/compiler.h:33:29:  [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, (__fmt), (__args))))
data/llmnrd-0.5/log.h:24:31:  [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.
#define log_err(fmt, args...)	fprintf(stderr, "Error: " fmt, ##args)
data/llmnrd-0.5/log.h:25:32:  [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.
#define log_warn(fmt, args...)	fprintf(stderr, "Warning: " fmt, ##args)
data/llmnrd-0.5/log.h:26:32:  [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.
#define log_info(fmt, args...)	fprintf(stdout, fmt, ##args)
data/llmnrd-0.5/log.h:28:32:  [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.
# define log_dbg(fmt, args...)	fprintf(stdout, fmt, ##args)
data/llmnrd-0.5/util.h:57:2:  [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(stderr, fmt, vl);
data/llmnrd-0.5/llmnr-query.c:110:14:  [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 ((c = getopt_long(argc, argv, short_ops, long_opts, NULL)) != -1) {
data/llmnrd-0.5/llmnrd.c:164:14:  [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 ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1) {
data/llmnrd-0.5/iface.c:117: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(&addrs[rec->size], addr, sizeof(*addr));
data/llmnrd-0.5/iface.c:140:4:  [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 as[NI_MAXHOST];
data/llmnrd-0.5/iface.c:216: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 ifname[IF_NAMESIZE];
data/llmnrd-0.5/iface.c:233: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 addr[INET6_ADDRSTRLEN];
data/llmnrd-0.5/llmnr-query.c:245:3:  [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(pkt_put(p, query_name_len), query_name, query_name_len);
data/llmnrd-0.5/llmnr-query.c:275:4:  [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(CMSG_DATA(cmsg), &ipi6, sizeof(ipi6));
data/llmnrd-0.5/llmnr-query.c:335: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 addr[INET6_ADDRSTRLEN + 1];
data/llmnrd-0.5/llmnr-query.c:338: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 name[LLMNR_LABEL_MAX_SIZE + 1];
data/llmnrd-0.5/llmnr-query.c:373:5:  [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(&sst, pkt_put(p, addr_size), addr_size);
data/llmnrd-0.5/llmnr.c:43:8:  [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.
static char llmnr_hostname[LLMNR_LABEL_MAX_SIZE + 2];
data/llmnrd-0.5/llmnr.c:144: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(pkt_put(p, query_len), query, query_len);
data/llmnrd-0.5/llmnr.c:167:4:  [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(pkt_put(p, llmnr_hostname[0] + 2), llmnr_hostname, llmnr_hostname[0] + 2);
data/llmnrd-0.5/llmnr.c:182:3:  [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(pkt_put(p, addr_size), addr, addr_size);
data/llmnrd-0.5/llmnrd.c:208: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).
		llmnrd_fd_hostname = open("/proc/sys/kernel/hostname", O_RDONLY|O_CLOEXEC|O_NDELAY);
data/llmnrd-0.5/pkt.h:104: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(data, &val, sizeof(uint##__bitwidth##_t));				\
data/llmnrd-0.5/socket.c:199: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 ifname[IF_NAMESIZE];
data/llmnrd-0.5/socket.c:228: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 ifname[IF_NAMESIZE];
data/llmnrd-0.5/util.c:67: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(ret, s, len);
data/llmnrd-0.5/iface.c:144:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
				strncpy(as, "<unknown>", sizeof(as) - 1);
data/llmnrd-0.5/iface.c:240:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
			strncpy(addr, "<unknown>", sizeof(addr) - 1);
data/llmnrd-0.5/llmnr-query.c:155:19:  [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).
	query_name_len = strlen(query_name);
data/llmnrd-0.5/llmnr-query.c:346:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
						strncpy(name, (char *)&p->data[ptr + 1], nnl);
data/llmnrd-0.5/llmnr-query.c:349:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
						strncpy(name, "<invalid>", LLMNR_LABEL_MAX_SIZE);
data/llmnrd-0.5/llmnr-query.c:351:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
					strncpy(name, (char *)pkt_put(p, nl + 1), nl);
data/llmnrd-0.5/llmnr-query.c:375:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
					strncpy(addr, "<invalid>", sizeof(addr));
data/llmnrd-0.5/llmnr-query.c:385:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(interval_ms * 1000);
data/llmnrd-0.5/llmnr.c:47:22:  [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).
	llmnr_hostname[0] = strlen(hostname);
data/llmnrd-0.5/llmnr.c:48:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(&llmnr_hostname[1], hostname, LLMNR_LABEL_MAX_SIZE);
data/llmnrd-0.5/llmnrd.c:146:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(hostname, newname, maxlen);
data/llmnrd-0.5/socket.c:46:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name) - 1);
data/llmnrd-0.5/util.c:64:15:  [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 len = strlen(s) + 1;
data/llmnrd-0.5/util.h:70:13:  [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 n = strlen(str1);
data/llmnrd-0.5/util.h:72: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).
	if (n != strlen(str2))

ANALYSIS SUMMARY:

Hits = 41
Lines analyzed = 2203 in approximately 0.07 seconds (32761 lines/second)
Physical Source Lines of Code (SLOC) = 1496
Hits@level = [0]   8 [1]  15 [2]  18 [3]   2 [4]   6 [5]   0
Hits@level+ = [0+]  49 [1+]  41 [2+]  26 [3+]   8 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 32.754 [1+] 27.4064 [2+] 17.3797 [3+] 5.34759 [4+] 4.0107 [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.