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/knockd-0.7/src/knock.c
Examining data/knockd-0.7/src/list.c
Examining data/knockd-0.7/src/list.h
Examining data/knockd-0.7/src/knockd.c

FINAL RESULTS:

data/knockd-0.7/src/knock.c:153:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vprintf(fmt, args);
data/knockd-0.7/src/knockd.c:285:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vprintf(fmt, args);
data/knockd-0.7/src/knockd.c:296:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vprintf(fmt, args);
data/knockd-0.7/src/knockd.c:308:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf(msg, 1024, fmt, args);
data/knockd-0.7/src/knockd.c:333:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vprintf(fmt, args);
data/knockd-0.7/src/knockd.c:338:6:  [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.
					printf((i == door->seqcount-1 ? "%u:udp\n" : "%u:udp,"), door->sequence[i]);
data/knockd-0.7/src/knockd.c:342:6:  [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.
					printf((i == door->seqcount-1 ? "%u:tcp\n" : "%u:tcp,"), door->sequence[i]);
data/knockd-0.7/src/knockd.c:573:7:  [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(door->target, ptr);
data/knockd-0.7/src/knockd.c:603:7:  [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(door->start_command, ptr);
data/knockd-0.7/src/knockd.c:614:7:  [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(door->stop_command, ptr);
data/knockd-0.7/src/knockd.c:976:3:  [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(door->pcap_filter_exp, buffer);
data/knockd-0.7/src/knockd.c:1059:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(*dest, src);
data/knockd-0.7/src/knockd.c:1190:8:  [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.
	ret = system(command);
data/knockd-0.7/src/knockd.c:1525:5:  [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(attempt->src, srcIP);
data/knockd-0.7/src/knock.c:69:15:  [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((opt = getopt_long(argc, argv, "vud:hV", opts, &optidx))) {
data/knockd-0.7/src/knockd.c:160:15:  [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((opt = getopt_long(argc, argv, "vDdli:c:p:g:hV", opts, &optidx))) {
data/knockd-0.7/src/list.c:220:9:  [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.
	cenv = getenv("COLUMNS");
data/knockd-0.7/src/knock.c:77:29:  [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).
			case 'd': o_delay = (int)atoi(optarg); break;
data/knockd-0.7/src/knock.c:103:11:  [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(arg);
data/knockd-0.7/src/knock.c:111:11:  [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(arg);
data/knockd-0.7/src/knockd.c:66: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 name[128];
data/knockd-0.7/src/knockd.c:92: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 src[16];   /* IP address */
data/knockd-0.7/src/knockd.c:128: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 myip[32];
data/knockd-0.7/src/knockd.c:135: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 o_int[32]           = "";		/* default (eth0) is set after parseconfig() */
data/knockd-0.7/src/knockd.c:136: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 o_cfg[PATH_MAX]     = "/etc/knockd.conf";
data/knockd-0.7/src/knockd.c:137: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 o_pidfile[PATH_MAX] = "/var/run/knockd.pid";
data/knockd-0.7/src/knockd.c:138: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 o_logfile[PATH_MAX] = "";
data/knockd-0.7/src/knockd.c:142: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 pcapErr[PCAP_ERRBUF_SIZE] = "";
data/knockd-0.7/src/knockd.c:202: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).
		logfd = fopen(o_logfile, "a");
data/knockd-0.7/src/knockd.c:252:15:  [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((pidfp = fopen(o_pidfile, "w"))) {
data/knockd-0.7/src/knockd.c:305: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[1024];
data/knockd-0.7/src/knockd.c:398:10:  [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).
	logfd = fopen(o_logfile, "a");
data/knockd-0.7/src/knockd.c:468: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 line[PATH_MAX+1];
data/knockd-0.7/src/knockd.c:472: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 section[256] = "";
data/knockd-0.7/src/knockd.c:476: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((fp = fopen(configfile, "r")) == NULL) {
data/knockd-0.7/src/knockd.c:583:41:  [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((door->one_time_sequences_fd = fopen(ptr, "r+")) == NULL) {
data/knockd-0.7/src/knockd.c:595:35:  [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).
						door->seq_timeout = (time_t)atoi(ptr);
data/knockd-0.7/src/knockd.c:606:35:  [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).
						door->cmd_timeout = (time_t)atoi(ptr);
data/knockd-0.7/src/knockd.c:691:54:  [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).
		door->sequence[door->seqcount++] = (unsigned short)atoi(port);
data/knockd-0.7/src/knockd.c:734: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 line[PATH_MAX+1];
data/knockd-0.7/src/knockd.c:814: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 port_str[10];     /* used by snprintf to convert unsigned short --> string */
data/knockd-0.7/src/knockd.c:1303: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 parsed_start_cmd[PATH_MAX];
data/knockd-0.7/src/knockd.c:1304: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 parsed_stop_cmd[PATH_MAX];
data/knockd-0.7/src/knockd.c:1368: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 proto[8];
data/knockd-0.7/src/knockd.c:1372: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 srcIP[16], dstIP[16];
data/knockd-0.7/src/knockd.c:1376: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 pkt_date[11];
data/knockd-0.7/src/knockd.c:1377: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 pkt_time[9];
data/knockd-0.7/src/list.c:222:13:  [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).
		maxcols = atoi(cenv);
data/knockd-0.7/src/knock.c:142:3:  [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(1000*o_delay);
data/knockd-0.7/src/knockd.c:170:14:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			case 'i': strncpy(o_int, optarg, sizeof(o_int)-1);
data/knockd-0.7/src/knockd.c:173:14:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			case 'c': strncpy(o_cfg, optarg, sizeof(o_cfg)-1);
data/knockd-0.7/src/knockd.c:176:14:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			case 'p': strncpy(o_pidfile, optarg, sizeof(o_pidfile)-1);
data/knockd-0.7/src/knockd.c:179:14:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			case 'g': strncpy(o_logfile, optarg, sizeof(o_logfile)-1);
data/knockd-0.7/src/knockd.c:194:5:  [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(strlen(o_int) == 0) {
data/knockd-0.7/src/knockd.c:195:3:  [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(o_int, "eth0", sizeof(o_int));	/* no explicit termination needed */
data/knockd-0.7/src/knockd.c:200:5:  [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(strlen(o_logfile)) {
data/knockd-0.7/src/knockd.c:211:5:  [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(strlen(pcapErr)) {
data/knockd-0.7/src/knockd.c:451: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).
		memmove(str, pch, (strlen(pch) + 1));
data/knockd-0.7/src/knockd.c:454:23:  [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).
	pch = (char*)(str + (strlen(str) - 1));
data/knockd-0.7/src/knockd.c:484:6:  [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(strlen(line) == 0 || line[0] == '#') {
data/knockd-0.7/src/knockd.c:487:29:  [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(line[0] == '[' && line[strlen(line)-1] == ']') {
data/knockd-0.7/src/knockd.c:491:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(section, ptr, sizeof(section));
data/knockd-0.7/src/knockd.c:492:12:  [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).
			section[strlen(section)-1] = '\0';
data/knockd-0.7/src/knockd.c:494: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).
			if(!strlen(section)) {
data/knockd-0.7/src/knockd.c:505:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(door->name, section, sizeof(door->name)-1);
data/knockd-0.7/src/knockd.c:519: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).
			if(!strlen(section)) {
data/knockd-0.7/src/knockd.c:543:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
						strncpy(o_logfile, ptr, PATH_MAX-1);
data/knockd-0.7/src/knockd.c:547:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
						strncpy(o_pidfile, ptr, PATH_MAX-1);
data/knockd-0.7/src/knockd.c:552:10:  [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(strlen(o_int) == 0) {
data/knockd-0.7/src/knockd.c:553:8:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
							strncpy(o_int, ptr, sizeof(o_int)-1);
data/knockd-0.7/src/knockd.c:568:45:  [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).
						door->target = malloc(sizeof(char) * (strlen(ptr)+1));
data/knockd-0.7/src/knockd.c:598:52:  [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).
						door->start_command = malloc(sizeof(char) * (strlen(ptr)+1));
data/knockd-0.7/src/knockd.c:609:51:  [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).
						door->stop_command = malloc(sizeof(char) * (strlen(ptr)+1));
data/knockd-0.7/src/knockd.c:740:6:  [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(strlen(line) == 0 || line[0] == '#') {
data/knockd-0.7/src/knockd.c:971: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).
		door->pcap_filter_exp = (char*)malloc(strlen(buffer) + 1);
data/knockd-0.7/src/knockd.c:1045: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).
	needed_size = strlen(*dest) + strlen(src) + 1;		/* '+ 1' for '\0' */
data/knockd-0.7/src/knockd.c:1045: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).
	needed_size = strlen(*dest) + strlen(src) + 1;		/* '+ 1' for '\0' */
data/knockd-0.7/src/knockd.c:1102:2:  [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/knockd-0.7/src/knockd.c:1110:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buf, inet_ntoa((*(struct sockaddr_in *)&ifr.ifr_addr).sin_addr), bufsize-1);
data/knockd-0.7/src/knockd.c:1128:23:  [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 command_len = strlen(command);
data/knockd-0.7/src/knockd.c:1299:38:  [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(attempt->door->start_command && strlen(attempt->door->start_command)) {
data/knockd-0.7/src/knockd.c:1412:3:  [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(proto, "tcp", sizeof(proto));
data/knockd-0.7/src/knockd.c:1418:3:  [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(proto, "udp", sizeof(proto));
data/knockd-0.7/src/knockd.c:1433:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(srcIP, inet_ntoa(inaddr), sizeof(srcIP)-1);
data/knockd-0.7/src/knockd.c:1436:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(dstIP, inet_ntoa(inaddr), sizeof(dstIP)-1);
data/knockd-0.7/src/list.c:225: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(title);
data/knockd-0.7/src/list.c:230:12:  [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 s = strlen((char*)lp->data)+1;

ANALYSIS SUMMARY:

Hits = 87
Lines analyzed = 2020 in approximately 0.12 seconds (16419 lines/second)
Physical Source Lines of Code (SLOC) = 1584
Hits@level = [0]  65 [1]  39 [2]  31 [3]   3 [4]  14 [5]   0
Hits@level+ = [0+] 152 [1+]  87 [2+]  48 [3+]  17 [4+]  14 [5+]   0
Hits/KSLOC@level+ = [0+] 95.9596 [1+] 54.9242 [2+] 30.303 [3+] 10.7323 [4+] 8.83838 [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.