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/unworkable-0.53/trace.c
Examining data/unworkable-0.53/includes.h
Examining data/unworkable-0.53/openbsd-compat/vwarn.c
Examining data/unworkable-0.53/openbsd-compat/vwarnx.c
Examining data/unworkable-0.53/openbsd-compat/warn.c
Examining data/unworkable-0.53/openbsd-compat/getaddrinfo.h
Examining data/unworkable-0.53/openbsd-compat/getaddrinfo.c
Examining data/unworkable-0.53/openbsd-compat/sha1.h
Examining data/unworkable-0.53/openbsd-compat/sys/tree.h
Examining data/unworkable-0.53/openbsd-compat/sys/queue.h
Examining data/unworkable-0.53/openbsd-compat/verr.c
Examining data/unworkable-0.53/openbsd-compat/strlcat.c
Examining data/unworkable-0.53/openbsd-compat/strlcpy.c
Examining data/unworkable-0.53/openbsd-compat/warnx.c
Examining data/unworkable-0.53/openbsd-compat/verrx.c
Examining data/unworkable-0.53/openbsd-compat/errx.c
Examining data/unworkable-0.53/openbsd-compat/err.c
Examining data/unworkable-0.53/openbsd-compat/sha1.c
Examining data/unworkable-0.53/openbsd-compat/strtonum.c
Examining data/unworkable-0.53/scheduler.c
Examining data/unworkable-0.53/ctl_server.c
Examining data/unworkable-0.53/torrent.c
Examining data/unworkable-0.53/main.c
Examining data/unworkable-0.53/xmalloc.c
Examining data/unworkable-0.53/bencode.c
Examining data/unworkable-0.53/util.c
Examining data/unworkable-0.53/buf.c
Examining data/unworkable-0.53/progressmeter.c
Examining data/unworkable-0.53/announce.c
Examining data/unworkable-0.53/network.c

FINAL RESULTS:

data/unworkable-0.53/openbsd-compat/getaddrinfo.c:488:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	    strcpy(head_res->ai_canonname, canonname);
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:548:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	    strcpy(serv, servent->s_name);
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:570:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	    strcpy(node, hostent->h_name);
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:581:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	    strcpy(node, ntoa_address);
data/unworkable-0.53/openbsd-compat/verr.c:49: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/unworkable-0.53/openbsd-compat/verrx.c:40: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/unworkable-0.53/openbsd-compat/vwarn.c:44: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/unworkable-0.53/openbsd-compat/vwarnx.c:40: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/unworkable-0.53/trace.c:59:8:  [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(out, fmt, vap);
data/unworkable-0.53/main.c:95: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, "sg:t:p:")) != -1) {
data/unworkable-0.53/main.c:167:2:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	srandom(time(NULL));
data/unworkable-0.53/network.c:86:6:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	r = random();
data/unworkable-0.53/scheduler.c:400:8:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
			j = random() % num_interested;
data/unworkable-0.53/scheduler.c:562:16:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
		idx = pieces[random() % peerpieces];
data/unworkable-0.53/announce.c:65: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 host[MAXHOSTNAMELEN], port[6], path[MAXPATHLEN], *c;
data/unworkable-0.53/announce.c:67: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 tbuf[3*SHA1_DIGEST_LENGTH+1];
data/unworkable-0.53/announce.c:68: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 pbuf[3*PEER_ID_LEN+1];
data/unworkable-0.53/announce.c:102: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(host, c, n);
data/unworkable-0.53/announce.c:112: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(port, c, n);
data/unworkable-0.53/announce.c:314: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(dump, c, len);
data/unworkable-0.53/buf.c:105: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 ((fd = open(path, O_RDONLY, 0600)) == -1) {
data/unworkable-0.53/buf.c:185: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((b->cb_buf + off), src, rlen);
data/unworkable-0.53/buf.c:272:2:  [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).
 open:
data/unworkable-0.53/buf.c:273: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 ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) {
data/unworkable-0.53/buf.c:275:9:  [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).
			goto open;
data/unworkable-0.53/buf.c:305:12:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	if ((fd = mkstemp(template)) == -1)
data/unworkable-0.53/ctl_server.c:308: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 *msg, piece[8];
data/unworkable-0.53/ctl_server.c:345: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 *msg, peer[32];
data/unworkable-0.53/main.c:78: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 blurb[MAX_WINSIZE+1];
data/unworkable-0.53/network.c:263: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(&p->sa.sin_addr, peerlist + i, 4);
data/unworkable-0.53/network.c:264: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(&p->sa.sin_port, peerlist + i + 4, 2);
data/unworkable-0.53/network.c:287: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 *ip, portstr[6];
data/unworkable-0.53/network.c:325: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(&p->sa.sin_addr, &sa.sin_addr, 4);
data/unworkable-0.53/network.c:326: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(&p->sa.sin_port, &sa.sin_port, 2);
data/unworkable-0.53/network.c:366: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(msg + 1, "BitTorrent protocol", 19);
data/unworkable-0.53/network.c:369: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(msg + 28, sc->tp->info_hash, 20);
data/unworkable-0.53/network.c:370: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(msg + 48, sc->peerid, 20);
data/unworkable-0.53/network.c:445: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(&p->info_hash, p->rxmsg + 8, 20);
data/unworkable-0.53/network.c:446: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(&p->id, p->rxmsg + 8 + 20, 20);
data/unworkable-0.53/network.c:496: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(&id, p->rxmsg, 1);
data/unworkable-0.53/network.c:612: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(p->bitfield, p->rxmsg+sizeof(id), bitfieldlen);
data/unworkable-0.53/network.c:938: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(msg, &msglen2, sizeof(msglen2));
data/unworkable-0.53/network.c:939: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(msg+sizeof(msglen2), &id, sizeof(id));
data/unworkable-0.53/network.c:940: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(msg+sizeof(msglen2)+sizeof(id), &idx, sizeof(idx));
data/unworkable-0.53/network.c:983: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(msg, &msglen2, sizeof(msglen2));
data/unworkable-0.53/network.c:984: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(msg+sizeof(msglen2), &id, sizeof(id));
data/unworkable-0.53/network.c:985: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(msg+sizeof(msglen2)+sizeof(id), &idx, sizeof(idx));
data/unworkable-0.53/network.c:986: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx), &offset, sizeof(offset));
data/unworkable-0.53/network.c:987: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx)+sizeof(offset), data, len);
data/unworkable-0.53/network.c:1044: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(msg, &msglen2, sizeof(msglen2));
data/unworkable-0.53/network.c:1045: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(msg+sizeof(msglen2), &id, sizeof(id));
data/unworkable-0.53/network.c:1046: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(msg+sizeof(msglen2)+sizeof(id), &idx, sizeof(idx));
data/unworkable-0.53/network.c:1047: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx), &off, sizeof(off));
data/unworkable-0.53/network.c:1048: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx)+sizeof(off), &blocklen, sizeof(blocklen));
data/unworkable-0.53/network.c:1075: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(msg, &msglen2, sizeof(msglen2));
data/unworkable-0.53/network.c:1076: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(msg+sizeof(msglen2), &id, sizeof(id));
data/unworkable-0.53/network.c:1077: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(msg+sizeof(msglen2)+sizeof(id), &idx, sizeof(idx));
data/unworkable-0.53/network.c:1078: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx), &off, sizeof(off));
data/unworkable-0.53/network.c:1079: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx)+sizeof(off), &blocklen, sizeof(blocklen));
data/unworkable-0.53/network.c:1100: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(msg, &len, sizeof(len));
data/unworkable-0.53/network.c:1101: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(msg+sizeof(len), &id, sizeof(id));
data/unworkable-0.53/network.c:1128: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(msg, &msglen2, sizeof(msglen2));
data/unworkable-0.53/network.c:1129: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(msg+sizeof(msglen), &id, sizeof(id));
data/unworkable-0.53/network.c:1130: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(msg+sizeof(msglen)+sizeof(id), bitfield, bitfieldlen);
data/unworkable-0.53/network.c:1152: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(msg, &len, sizeof(len));
data/unworkable-0.53/network.c:1153: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(msg+sizeof(len), &id, sizeof(id));
data/unworkable-0.53/network.c:1176: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(msg, &len, sizeof(len));
data/unworkable-0.53/network.c:1177: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(msg+sizeof(len), &id, sizeof(id));
data/unworkable-0.53/network.c:1218: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(msg, &len, sizeof(len));
data/unworkable-0.53/network.c:1219: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(msg+sizeof(len), &id, sizeof(id));
data/unworkable-0.53/network.c:1240: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(msg, &len, sizeof(len));
data/unworkable-0.53/network.c:1241: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(msg+sizeof(len), &id, sizeof(id));
data/unworkable-0.53/network.c:1267: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(msg, &msglen2, sizeof(msglen2));
data/unworkable-0.53/network.c:1268: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(msg+sizeof(msglen2), &id, sizeof(id));
data/unworkable-0.53/network.c:1269: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(msg+sizeof(msglen2)+sizeof(id), &idx, sizeof(idx));
data/unworkable-0.53/network.c:1270: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx), &off, sizeof(off));
data/unworkable-0.53/network.c:1271: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(msg+sizeof(msglen2)+sizeof(id)+sizeof(idx)+sizeof(off), &blocklen, sizeof(blocklen));
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:111:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define memcpy(d, s, n) bcopy((s), (d), (n))
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:111:25:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define memcpy(d, s, n) bcopy((s), (d), (n))
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:365:19:  [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 = htons(atoi(servname));
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:476: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(&sa_in->sin_addr, *ap, sizeof(struct in_addr));
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:554:6:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	    sprintf(serv, "%d", ntohs(sa_in->sin_port));
data/unworkable-0.53/openbsd-compat/sha1.c:60:8:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	(void)memcpy(block, buffer, SHA1_BLOCK_LENGTH);
data/unworkable-0.53/openbsd-compat/sha1.c:131:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		(void)memcpy(&context->buffer[j], data, (i = 64-j));
data/unworkable-0.53/openbsd-compat/sha1.c:139:8:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	(void)memcpy(&context->buffer[j], &data[i], len - i);
data/unworkable-0.53/progressmeter.c:126: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_WINSIZE + 1];
data/unworkable-0.53/scheduler.c:626: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 tbuf[64];
data/unworkable-0.53/torrent.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(ret, result, SHA1_DIGEST_LENGTH);
data/unworkable-0.53/torrent.c:353: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(tmmp->addr, (u_int8_t *)d + diff,
data/unworkable-0.53/torrent.c:359: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(tmmp->addr, (u_int8_t *)d + diff, bytesleft);
data/unworkable-0.53/torrent.c:377: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(aptr, d, tlen);
data/unworkable-0.53/torrent.c:381: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(aptr, d, len);
data/unworkable-0.53/torrent.c:446: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(bptr, aptr, ilen);
data/unworkable-0.53/torrent.c:456: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(bptr, aptr, tlen);
data/unworkable-0.53/torrent.c:496: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[MAXPATHLEN], *buf2, zero = 0x00, *basedir;
data/unworkable-0.53/torrent.c:504:2:  [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).
	open:
data/unworkable-0.53/torrent.c:524:13:  [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(buf, openflags, 0600)) == -1)
data/unworkable-0.53/torrent.c:547:8:  [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).
		goto open;
data/unworkable-0.53/torrent.c:890: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 resumename[MAXPATHLEN];
data/unworkable-0.53/torrent.c:904:12:  [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 ((fp = fopen(resumename, "w")) == NULL)
data/unworkable-0.53/torrent.c:925: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 resumename[MAXPATHLEN];
data/unworkable-0.53/torrent.c:938:12:  [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 ((fp = fopen(resumename, "r")) == NULL)
data/unworkable-0.53/trace.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 tbuf[32];
data/unworkable-0.53/trace.c:51:14:  [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 ((out = fopen(unworkable_trace, "w")) == NULL)
data/unworkable-0.53/announce.c:123: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 (path[strlen(path) - 1] == '/')
data/unworkable-0.53/announce.c:124: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).
		path[strlen(path) - 1] = '\0';
data/unworkable-0.53/announce.c:208:40:  [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 (bufferevent_write(bufev, request, strlen(request) + 1) != 0)
data/unworkable-0.53/announce.c:292:27:  [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 (strncmp(c, HTTP_1_0, strlen(HTTP_1_0)) != 0 && strncmp(c, HTTP_1_1, strlen(HTTP_1_1))) {
data/unworkable-0.53/announce.c:292:74:  [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 (strncmp(c, HTTP_1_0, strlen(HTTP_1_0)) != 0 && strncmp(c, HTTP_1_1, strlen(HTTP_1_1))) {
data/unworkable-0.53/announce.c:296:7:  [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).
	c += strlen(HTTP_1_0) + 1;
data/unworkable-0.53/announce.c:297:26:  [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 (strncmp(c, HTTP_OK, strlen(HTTP_OK)) != 0) {
data/unworkable-0.53/announce.c:298: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).
		*(c + strlen(HTTP_OK)) = '\0';
data/unworkable-0.53/announce.c:307:7:  [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).
	c += strlen(HTTP_END);
data/unworkable-0.53/buf.c:116:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, bp, len);
data/unworkable-0.53/ctl_server.c:280:39:  [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 (bufferevent_write(csc->bev, msg, strlen(msg)) != 0)
data/unworkable-0.53/network.c:399:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		goto read;
data/unworkable-0.53/network.c:408:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			goto read;
data/unworkable-0.53/network.c:410:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		read:
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:486:42:  [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).
	head_res->ai_canonname = (char *)malloc(strlen(canonname) + 1);
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:544:21:  [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 (servlen <= strlen(servent->s_name)) {
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:566:21:  [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 (nodelen <= strlen(hostent->h_name)) {
data/unworkable-0.53/openbsd-compat/getaddrinfo.c:577:21:  [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 (nodelen <= strlen(ntoa_address)) {
data/unworkable-0.53/openbsd-compat/strlcat.c:46:17:  [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).
		return(dlen + strlen(s));
data/unworkable-0.53/progressmeter.c:182:17:  [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).
	snprintf(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:182:41:  [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).
	snprintf(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:186: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).
	format_size(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:186:44:  [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).
	format_size(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:191: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).
	format_rate(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:191:44:  [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).
	format_rate(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:217: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).
			snprintf(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:217:43:  [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).
			snprintf(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:220: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).
			snprintf(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/progressmeter.c:220:43:  [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).
			snprintf(buf + strlen(buf), win_size - strlen(buf),
data/unworkable-0.53/torrent.c:74:7:  [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).
	p += strlen(INFO_STR);
data/unworkable-0.53/xmalloc.c:72: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(str) + 1;
data/unworkable-0.53/xmalloc.c:85: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).
	char *y = xmalloc(strlen(x) + 1);
data/unworkable-0.53/xmalloc.c:87: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).
	strlcpy(y, x, strlen(x) + 1);

ANALYSIS SUMMARY:

Hits = 137
Lines analyzed = 8921 in approximately 0.28 seconds (32114 lines/second)
Physical Source Lines of Code (SLOC) = 6093
Hits@level = [0]  84 [1]  33 [2]  90 [3]   5 [4]   9 [5]   0
Hits@level+ = [0+] 221 [1+] 137 [2+] 104 [3+]  14 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 36.2711 [1+] 22.4848 [2+] 17.0688 [3+] 2.29772 [4+] 1.4771 [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.