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/unixcw-3.5.1/src/libcw/libcw_rec.c
Examining data/unixcw-3.5.1/src/libcw/libcw_pa.c
Examining data/unixcw-3.5.1/src/libcw/libcw_alsa.h
Examining data/unixcw-3.5.1/src/libcw/libcw_key.h
Examining data/unixcw-3.5.1/src/libcw/libcw_tq.h
Examining data/unixcw-3.5.1/src/libcw/libcw_console.h
Examining data/unixcw-3.5.1/src/libcw/libcw_debug.c
Examining data/unixcw-3.5.1/src/libcw/libcw_utils.h
Examining data/unixcw-3.5.1/src/libcw/libcw_null.c
Examining data/unixcw-3.5.1/src/libcw/libcw_utils.c
Examining data/unixcw-3.5.1/src/libcw/libcw_signal.h
Examining data/unixcw-3.5.1/src/libcw/libcw_alsa.c
Examining data/unixcw-3.5.1/src/libcw/libcw_debug.h
Examining data/unixcw-3.5.1/src/libcw/libcw_console.c
Examining data/unixcw-3.5.1/src/libcw/libcw_rec.h
Examining data/unixcw-3.5.1/src/libcw/libcw_key.c
Examining data/unixcw-3.5.1/src/libcw/libcw_oss.h
Examining data/unixcw-3.5.1/src/libcw/libcw_test_internal.c
Examining data/unixcw-3.5.1/src/libcw/libcw_data.c
Examining data/unixcw-3.5.1/src/libcw/libcw.h
Examining data/unixcw-3.5.1/src/libcw/libcw_gen.h
Examining data/unixcw-3.5.1/src/libcw/libcw_oss.c
Examining data/unixcw-3.5.1/src/libcw/tests/libcw_test_tq_short_space.c
Examining data/unixcw-3.5.1/src/libcw/tests/libcw_test.h
Examining data/unixcw-3.5.1/src/libcw/tests/libcw_test_simple_gen.c
Examining data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c
Examining data/unixcw-3.5.1/src/libcw/tests/libcw_test.c
Examining data/unixcw-3.5.1/src/libcw/libcw_null.h
Examining data/unixcw-3.5.1/src/libcw/libcw_pa.h
Examining data/unixcw-3.5.1/src/libcw/libcw.c
Examining data/unixcw-3.5.1/src/libcw/libcw_tq.c
Examining data/unixcw-3.5.1/src/libcw/libcw_data.h
Examining data/unixcw-3.5.1/src/libcw/libcw_signal.c
Examining data/unixcw-3.5.1/src/libcw/libcw_gen.c
Examining data/unixcw-3.5.1/src/cwutils/dictionary.c
Examining data/unixcw-3.5.1/src/cwutils/memory.c
Examining data/unixcw-3.5.1/src/cwutils/cw_common.h
Examining data/unixcw-3.5.1/src/cwutils/cw_common.c
Examining data/unixcw-3.5.1/src/cwutils/dictionary.h
Examining data/unixcw-3.5.1/src/cwutils/memory.h
Examining data/unixcw-3.5.1/src/cwutils/cw_copyright.h
Examining data/unixcw-3.5.1/src/cwutils/i18n.h
Examining data/unixcw-3.5.1/src/cwutils/cw_words.h
Examining data/unixcw-3.5.1/src/cwutils/cmdline.h
Examining data/unixcw-3.5.1/src/cwutils/cmdline.c
Examining data/unixcw-3.5.1/src/cwutils/i18n.c
Examining data/unixcw-3.5.1/src/cwgen/cwgen.c
Examining data/unixcw-3.5.1/src/xcwcp/modeset.h
Examining data/unixcw-3.5.1/src/xcwcp/sender.cc
Examining data/unixcw-3.5.1/src/xcwcp/sender.h
Examining data/unixcw-3.5.1/src/xcwcp/main.cc
Examining data/unixcw-3.5.1/src/xcwcp/receiver.cc
Examining data/unixcw-3.5.1/src/xcwcp/modeset.cc
Examining data/unixcw-3.5.1/src/xcwcp/application.h
Examining data/unixcw-3.5.1/src/xcwcp/textarea.cc
Examining data/unixcw-3.5.1/src/xcwcp/application.cc
Examining data/unixcw-3.5.1/src/xcwcp/receiver.h
Examining data/unixcw-3.5.1/src/xcwcp/textarea.h
Examining data/unixcw-3.5.1/src/cw/cw.c
Examining data/unixcw-3.5.1/src/cw/cw.h
Examining data/unixcw-3.5.1/src/cwcp/cwcp.c

FINAL RESULTS:

data/unixcw-3.5.1/src/cw/cw.c:95:7:  [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 (stdout, format, ap);
data/unixcw-3.5.1/src/cw/cw.c:109:7:  [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, format, ap);
data/unixcw-3.5.1/src/cw/cw.c:133:3:  [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 (buffer, sizeof (buffer), format, ap);
data/unixcw-3.5.1/src/cwcp/cwcp.c:662:2:  [4] (format) snprintf:
  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.
	snprintf(buffer, CWCP_PARAM_WIDTH, total == 1 ? _("%2d/%2d min ") : _("%2d/%2d mins"), el, total);
data/unixcw-3.5.1/src/cwcp/cwcp.c:1501:2:  [4] (format) snprintf:
  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.
	snprintf(buffer, CWCP_PARAM_WIDTH, value == 1 ? _("%2d dot ") : _("%2d dots"), value);
data/unixcw-3.5.1/src/cwgen/cwgen.c:195:2:  [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, format, program_name);
data/unixcw-3.5.1/src/cwgen/cwgen.c:301:8:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
			if (sscanf(argument, "%" SCNu64, &(config->n_chars_max)) != 1
data/unixcw-3.5.1/src/cwutils/cmdline.c:598:2:  [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, format, program_name);
data/unixcw-3.5.1/src/cwutils/dictionary.c:513:5:  [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(content, line);
data/unixcw-3.5.1/src/cwutils/dictionary.c:516: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(content, line);
data/unixcw-3.5.1/src/cwutils/dictionary.c:736:3:  [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(stream, chars > 0 ? "\n\n" : "\n");
data/unixcw-3.5.1/src/cwutils/memory.c:89: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 (copy, s);
data/unixcw-3.5.1/src/libcw/libcw_data.c:334:4:  [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(representation, retval);
data/unixcw-3.5.1/src/libcw/libcw_data.c:1060:4:  [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(expansion, retval);
data/unixcw-3.5.1/src/libcw/libcw_data.c:1175:4:  [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(phonetic, CW_PHONETICS[c - 'A']);
data/unixcw-3.5.1/src/libcw/libcw_debug.h:89: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, __VA_ARGS__);			\
data/unixcw-3.5.1/src/libcw/libcw_debug.h:137:71:  [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 cw_vdm(...) fprintf(stderr, "%s():%d: ", __func__, __LINE__); fprintf(stderr, __VA_ARGS__);
data/unixcw-3.5.1/src/cwgen/cwgen.c:118:3:  [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(t.tv_usec);
data/unixcw-3.5.1/src/cwgen/cwgen.c:136:45:  [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.
		int group_size = config->group_size_min + random() % (config->group_size_max - config->group_size_min + 1);
data/unixcw-3.5.1/src/cwgen/cwgen.c:140:32:  [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.
			buffer[i] = config->charset[random() % charset_length];
data/unixcw-3.5.1/src/cwutils/cmdline.c:107:22:  [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.
	char *env_options = getenv(env_variable);
data/unixcw-3.5.1/src/cwutils/cmdline.c:246:8:  [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.
	opt = getopt_long(argc, argv, option_string, long_options, NULL);
data/unixcw-3.5.1/src/cwutils/cmdline.c:248:8:  [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.
	opt = getopt(argc, argv, option_string);
data/unixcw-3.5.1/src/cwutils/dictionary.c:821:3:  [3] (random) srand:
  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.
		srand(time(NULL));
data/unixcw-3.5.1/src/libcw/libcw_debug.c:208:30:  [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.
			const char *debug_value = getenv("LIBCW_DEBUG");
data/unixcw-3.5.1/src/libcw/libcw_test_internal.c:147:2:  [3] (random) srand:
  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.
	srand((int) tv.tv_usec);
data/unixcw-3.5.1/src/libcw/tests/libcw_test.c:83:16:  [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 ((opt = getopt(argc, argv, "m:s:")) != -1) {
data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c:1905:2:  [3] (random) srand:
  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.
	srand(seed.tv_usec);
data/unixcw-3.5.1/src/cw/cw.c:126: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 buffer[128];
data/unixcw-3.5.1/src/cwcp/cwcp.c:183:17:  [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 volatile char queue_data[QUEUE_CAPACITY];
data/unixcw-3.5.1/src/cwcp/cwcp.c:437: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 buffer[2];
data/unixcw-3.5.1/src/cwcp/cwcp.c:661: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 buffer[CWCP_PARAM_WIDTH];
data/unixcw-3.5.1/src/cwcp/cwcp.c:1460: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 buffer[CWCP_PARAM_WIDTH];
data/unixcw-3.5.1/src/cwcp/cwcp.c:1473: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 buffer[CWCP_PARAM_WIDTH];
data/unixcw-3.5.1/src/cwcp/cwcp.c:1486: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 buffer[CWCP_PARAM_WIDTH];
data/unixcw-3.5.1/src/cwcp/cwcp.c:1499: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 buffer[CWCP_PARAM_WIDTH];
data/unixcw-3.5.1/src/cwutils/cmdline.c:458:16:  [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).
			int speed = atoi(optarg);
data/unixcw-3.5.1/src/cwutils/cmdline.c:471:20:  [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).
			int frequency = atoi(optarg);
data/unixcw-3.5.1/src/cwutils/cmdline.c:484:17:  [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).
			int volume = atoi(optarg);
data/unixcw-3.5.1/src/cwutils/cmdline.c:497:14:  [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).
			int gap = atoi(optarg);
data/unixcw-3.5.1/src/cwutils/cmdline.c:510:20:  [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).
			int weighting = atoi(optarg);
data/unixcw-3.5.1/src/cwutils/cmdline.c:523:15:  [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).
			int time = atoi(optarg);
data/unixcw-3.5.1/src/cwutils/dictionary.c:622:17:  [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).
	FILE *stream = fopen(file, "r");
data/unixcw-3.5.1/src/cwutils/dictionary.c:712:17:  [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).
	FILE *stream = fopen(file, "w");
data/unixcw-3.5.1/src/libcw/libcw_alsa.c:292:22:  [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).
	gen->dev_raw_sink = open("/tmp/cw_file.alsa.raw", O_WRONLY | O_TRUNC | O_NONBLOCK);
data/unixcw-3.5.1/src/libcw/libcw_console.c:123:11:  [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).
	int fd = open(dev, O_WRONLY);
data/unixcw-3.5.1/src/libcw/libcw_console.c:170:16:  [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).
	int console = open(gen->audio_device, O_WRONLY);
data/unixcw-3.5.1/src/libcw/libcw_data.c:1087:14:  [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 const char *const CW_PHONETICS[27] = {
data/unixcw-3.5.1/src/libcw/libcw_data.c:1336: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 input[REPRESENTATION_TABLE_SIZE][REPRESENTATION_LEN + 1];
data/unixcw-3.5.1/src/libcw/libcw_data.c:1490: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 charlist[UCHAR_MAX + 1];
data/unixcw-3.5.1/src/libcw/libcw_data.c:1594: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 charlist[UCHAR_MAX + 1];
data/unixcw-3.5.1/src/libcw/libcw_data.c:1630: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 expansion[256];
data/unixcw-3.5.1/src/libcw/libcw_data.c:1686: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 phonetic[256];
data/unixcw-3.5.1/src/libcw/libcw_data.c:1728: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 charlist[UCHAR_MAX + 1];
data/unixcw-3.5.1/src/libcw/libcw_data.c:1767: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 charlist[UCHAR_MAX + 1];
data/unixcw-3.5.1/src/libcw/libcw_oss.c:119: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).
	int soundcard = open(dev, O_WRONLY);
data/unixcw-3.5.1/src/libcw/libcw_oss.c:226: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).
	int soundcard = open(gen->audio_device, O_WRONLY);
data/unixcw-3.5.1/src/libcw/libcw_oss.c:273:22:  [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).
	gen->dev_raw_sink = open("/tmp/cw_file.oss.raw", O_WRONLY | O_TRUNC | O_NONBLOCK);
data/unixcw-3.5.1/src/libcw/libcw_pa.c:341:22:  [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).
	gen->dev_raw_sink = open("/tmp/cw_file.pa.raw", O_WRONLY | O_TRUNC | O_NONBLOCK);
data/unixcw-3.5.1/src/libcw/libcw_rec.c:1538: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 representation[CW_REC_REPRESENTATION_CAPACITY + 1];
data/unixcw-3.5.1/src/libcw/libcw_rec.c:2050: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 representation[CW_REC_REPRESENTATION_CAPACITY + 1];
data/unixcw-3.5.1/src/libcw/libcw_rec.h:151: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 representation[CW_REC_REPRESENTATION_CAPACITY + 1];
data/unixcw-3.5.1/src/libcw/libcw_utils.c:961: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 buffer[VERSION_LEN_MAX + 1];
data/unixcw-3.5.1/src/libcw/libcw_utils.c:976:14:  [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).
			current = atoi(token);
data/unixcw-3.5.1/src/libcw/libcw_utils.c:978:15:  [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).
			revision = atoi(token);
data/unixcw-3.5.1/src/libcw/libcw_utils.c:980:10:  [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).
			age = atoi(token);
data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c:1044: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 charlist[UCHAR_MAX + 1];
data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c:1081: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 charlist[UCHAR_MAX + 1];
data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c:1921: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 sound_systems[CW_SYSTEMS_MAX + 1];
data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c:1923: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 modules[CW_MODULES_MAX + 1];
data/unixcw-3.5.1/src/libcw/tests/libcw_test_simple_gen.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 sound_systems[CW_SYSTEMS_MAX + 1];
data/unixcw-3.5.1/src/libcw/tests/libcw_test_simple_gen.c:72: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 modules[CW_MODULES_MAX + 1];
data/unixcw-3.5.1/src/libcw/tests/libcw_test_tq_short_space.c:50:7:  [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).
		n = atoi(argv[1]);
data/unixcw-3.5.1/src/cw/cw.c:167:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  c = toupper (fgetc (stream));
data/unixcw-3.5.1/src/cw/cw.c:224:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  c = toupper (fgetc (stream));
data/unixcw-3.5.1/src/cw/cw.c:382:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  c = toupper (fgetc (stream));
data/unixcw-3.5.1/src/cw/cw.c:483:12:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  for (c = fgetc (stream); !feof (stream); c = fgetc (stream))
data/unixcw-3.5.1/src/cw/cw.c:483:48:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  for (c = fgetc (stream); !feof (stream); c = fgetc (stream))
data/unixcw-3.5.1/src/cw/cw.c:535:27:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
              lookahead = fgetc (stream);
data/unixcw-3.5.1/src/cw/cw.c:608:3:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		getchar();
data/unixcw-3.5.1/src/cwcp/cwcp.c:1742:3:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		getchar();
data/unixcw-3.5.1/src/cwgen/cwgen.c:130: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).
	int charset_length = strlen(config->charset);
data/unixcw-3.5.1/src/cwgen/cwgen.c:311: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(argument) == 0) {
data/unixcw-3.5.1/src/cwutils/cmdline.c:214: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).
						      strlen(option_string) + 3);
data/unixcw-3.5.1/src/cwutils/cmdline.c:215:4:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
			strncat(option_string, element, needs_arg ? 2 : 1);
data/unixcw-3.5.1/src/cwutils/cmdline.c:447: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).
		if (optarg && strlen(optarg)) {
data/unixcw-3.5.1/src/cwutils/cmdline.c:534: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).
		if (optarg && strlen(optarg)) {
data/unixcw-3.5.1/src/cwutils/cmdline.c:544: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).
		if (optarg && strlen(optarg)) {
data/unixcw-3.5.1/src/cwutils/cw_common.c:423:18:  [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 bytes = strlen(buffer);
data/unixcw-3.5.1/src/cwutils/dictionary.c:165:24:  [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).
		is_multicharacter |= strlen(wordlist[word]) > 1;
data/unixcw-3.5.1/src/cwutils/dictionary.c:285:18:  [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 index == strlen(line) || strchr(";#", line[0]);
data/unixcw-3.5.1/src/cwutils/dictionary.c:311: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).
	char *name = safe_malloc(strlen(line) + 1);
data/unixcw-3.5.1/src/cwutils/dictionary.c:316:34:  [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).
		*name_ptr = safe_realloc(name, strlen(name) + 1);
data/unixcw-3.5.1/src/cwutils/dictionary.c:381: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).
	size_t bytes = strlen(buffer);
data/unixcw-3.5.1/src/cwutils/dictionary.c:416:24:  [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 *errors = malloc(strlen(line) + 1);
data/unixcw-3.5.1/src/cwutils/dictionary.c:511:14:  [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).
						       strlen(content) + strlen(line) + 2);
data/unixcw-3.5.1/src/cwutils/dictionary.c:511: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).
						       strlen(content) + strlen(line) + 2);
data/unixcw-3.5.1/src/cwutils/dictionary.c:512:5:  [1] (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). Risk is low because the
  source is a constant character.
				strcat(content, " ");
data/unixcw-3.5.1/src/cwutils/dictionary.c:515: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).
				content = safe_malloc(strlen(line) + 1);
data/unixcw-3.5.1/src/cwutils/dictionary.c:730: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).
			chars += strlen(dict->wordlist[i]) + 1;
data/unixcw-3.5.1/src/cwutils/memory.c:82:18:  [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).
  copy = malloc (strlen (s) + 1);
data/unixcw-3.5.1/src/libcw/libcw_data.c:225: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).
			int length = (int) strlen (cw_entry->representation);
data/unixcw-3.5.1/src/libcw/libcw_data.c:424: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).
	int length = (int) strlen (representation);
data/unixcw-3.5.1/src/libcw/libcw_data.c:943: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).
			size_t length = strlen(e->expansion);
data/unixcw-3.5.1/src/libcw/libcw_data.c:1135: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).
			size_t length = strlen(CW_PHONETICS[phonetic]);
data/unixcw-3.5.1/src/libcw/libcw_data.c:1499: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).
		size_t len = strlen(charlist);
data/unixcw-3.5.1/src/libcw/libcw_data.c:1600: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).
		size_t len = strlen(charlist);
data/unixcw-3.5.1/src/libcw/libcw_data.c:1640: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).
			if ((strlen(expansion) != 2 && strlen(expansion) != 3)
data/unixcw-3.5.1/src/libcw/libcw_data.c:1640:35:  [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(expansion) != 2 && strlen(expansion) != 3)
data/unixcw-3.5.1/src/libcw/libcw_gen.c:251: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(100000);
data/unixcw-3.5.1/src/libcw/libcw_gen.c:374: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(2 * gen->quantum_len);
data/unixcw-3.5.1/src/libcw/libcw_gen.c:578:2:  [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(500);
data/unixcw-3.5.1/src/libcw/libcw_gen.c:939: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(1000);
data/unixcw-3.5.1/src/libcw/libcw_key.c:887: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);
data/unixcw-3.5.1/src/libcw/libcw_rec.c:1466:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(representation, rec->representation, rec->representation_ind);
data/unixcw-3.5.1/src/libcw/libcw_rec.c:1517:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(representation, rec->representation, rec->representation_ind);
data/unixcw-3.5.1/src/libcw/libcw_rec.c:2041: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).
			cw_assert (n == (int) strlen(data[i].r),
data/unixcw-3.5.1/src/libcw/libcw_rec.c:2043: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).
				   n, strlen(data[i].r));
data/unixcw-3.5.1/src/libcw/libcw_rec.c:2186: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(base_characters);
data/unixcw-3.5.1/src/libcw/libcw_rec.c:2414:18:  [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 length = strlen(base_characters);
data/unixcw-3.5.1/src/libcw/libcw_rec.c:2580: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(characters);
data/unixcw-3.5.1/src/libcw/libcw_rec.c:2631: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 rep_length = strlen(test_data[out].r);
data/unixcw-3.5.1/src/libcw/libcw_utils.c:959: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).
	cw_assert (strlen(LIBCW_VERSION) <= VERSION_LEN_MAX, "LIBCW_VERSION longer than expected!\n");
data/unixcw-3.5.1/src/libcw/libcw_utils.c:962:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buffer, LIBCW_VERSION, VERSION_LEN_MAX);
data/unixcw-3.5.1/src/libcw/tests/libcw_test.c:70:2:  [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(sound_systems, "ncoap", systems_max);
data/unixcw-3.5.1/src/libcw/tests/libcw_test.c:73:2:  [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(modules, "gtko", modules_max);
data/unixcw-3.5.1/src/libcw/tests/libcw_test.c:87:18:  [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(optarg);
data/unixcw-3.5.1/src/libcw/tests/libcw_test.c:111:18:  [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(optarg);
data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c:316:2:  [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(duration / 4);
data/unixcw-3.5.1/src/libcw/tests/libcw_test_public.c:369:2:  [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(duration / 4);
data/unixcw-3.5.1/src/libcw/tests/libcw_test_tq_short_space.c:124: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(300);

ANALYSIS SUMMARY:

Hits = 131
Lines analyzed = 31183 in approximately 0.78 seconds (39999 lines/second)
Physical Source Lines of Code (SLOC) = 13521
Hits@level = [0] 474 [1]  58 [2]  45 [3]  11 [4]  17 [5]   0
Hits@level+ = [0+] 605 [1+] 131 [2+]  73 [3+]  28 [4+]  17 [5+]   0
Hits/KSLOC@level+ = [0+] 44.7452 [1+] 9.68863 [2+] 5.39901 [3+] 2.07085 [4+] 1.2573 [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.