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/rtl-sdr-0.6.0/include/reg_field.h
Examining data/rtl-sdr-0.6.0/include/rtl-sdr_export.h
Examining data/rtl-sdr-0.6.0/include/rtlsdr_i2c.h
Examining data/rtl-sdr-0.6.0/include/tuner_e4k.h
Examining data/rtl-sdr-0.6.0/include/tuner_fc0012.h
Examining data/rtl-sdr-0.6.0/include/tuner_fc0013.h
Examining data/rtl-sdr-0.6.0/include/tuner_fc2580.h
Examining data/rtl-sdr-0.6.0/include/tuner_r82xx.h
Examining data/rtl-sdr-0.6.0/include/rtl-sdr.h
Examining data/rtl-sdr-0.6.0/src/convenience/convenience.c
Examining data/rtl-sdr-0.6.0/src/convenience/convenience.h
Examining data/rtl-sdr-0.6.0/src/getopt/getopt.c
Examining data/rtl-sdr-0.6.0/src/getopt/getopt.h
Examining data/rtl-sdr-0.6.0/src/rtl_adsb.c
Examining data/rtl-sdr-0.6.0/src/rtl_sdr.c
Examining data/rtl-sdr-0.6.0/src/rtl_test.c
Examining data/rtl-sdr-0.6.0/src/tuner_e4k.c
Examining data/rtl-sdr-0.6.0/src/tuner_fc0012.c
Examining data/rtl-sdr-0.6.0/src/tuner_fc2580.c
Examining data/rtl-sdr-0.6.0/src/tuner_r82xx.c
Examining data/rtl-sdr-0.6.0/src/rtl_eeprom.c
Examining data/rtl-sdr-0.6.0/src/librtlsdr.c
Examining data/rtl-sdr-0.6.0/src/rtl_biast.c
Examining data/rtl-sdr-0.6.0/src/tuner_fc0013.c
Examining data/rtl-sdr-0.6.0/src/rtl_fm.c
Examining data/rtl-sdr-0.6.0/src/rtl_power.c
Examining data/rtl-sdr-0.6.0/src/rtl_tcp.c

FINAL RESULTS:

data/rtl-sdr-0.6.0/src/rtl_eeprom.c:59: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, conf->have_serial ? "yes\n": "no\n");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:61: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, conf->enable_ir ? "yes\n": "no\n");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:63: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, conf->remote_wakeup ? "yes\n": "no\n");
data/rtl-sdr-0.6.0/src/getopt/getopt.c:210: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.
#ifndef getenv
data/rtl-sdr-0.6.0/src/getopt/getopt.c:215:14:  [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.
extern char *getenv ();
data/rtl-sdr-0.6.0/src/getopt/getopt.c:401:21:  [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.
  posixly_correct = getenv ("POSIXLY_CORRECT");
data/rtl-sdr-0.6.0/src/getopt/getopt.c:976:1:  [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.
getopt (argc, argv, optstring)
data/rtl-sdr-0.6.0/src/getopt/getopt.c:1006:11:  [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.
      c = getopt (argc, argv, "abc:d:0123456789");
data/rtl-sdr-0.6.0/src/getopt/getopt.h:145:12:  [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.
extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
data/rtl-sdr-0.6.0/src/getopt/getopt.h:147:12:  [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.
extern int getopt ();
data/rtl-sdr-0.6.0/src/getopt/getopt.h:151:12:  [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.
extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
data/rtl-sdr-0.6.0/src/getopt/getopt.h:164:12:  [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.
extern int getopt ();
data/rtl-sdr-0.6.0/src/getopt/getopt.h:166:12:  [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.
extern int getopt_long ();
data/rtl-sdr-0.6.0/src/rtl_adsb.c:380: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, "d:g:p:e:Q:VST")) != -1)
data/rtl-sdr-0.6.0/src/rtl_biast.c:59: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, "d:b:g:h?")) != -1) {
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:267: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, "d:m:p:s:i:g:w:r:h?")) != -1) {
data/rtl-sdr-0.6.0/src/rtl_fm.c:1065: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, "d:f:g:s:b:l:o:t:r:p:E:F:A:M:hT")) != -1) {
data/rtl-sdr-0.6.0/src/rtl_power.c:794: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, "f:i:s:t:d:g:p:e:w:c:F:1PDOhT")) != -1) {
data/rtl-sdr-0.6.0/src/rtl_sdr.c:124: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, "d:f:g:s:b:n:p:S")) != -1) {
data/rtl-sdr-0.6.0/src/rtl_tcp.c:409: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, "a:p:f:g:s:b:n:d:P:T")) != -1) {
data/rtl-sdr-0.6.0/src/rtl_test.c:318: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, "d:s:b:tp::Sh")) != -1) {
data/rtl-sdr-0.6.0/include/reg_field.h:20: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[32];
data/rtl-sdr-0.6.0/src/convenience/convenience.c:252: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 vendor[256], product[256], serial[256];
data/rtl-sdr-0.6.0/src/librtlsdr.c:479:11:  [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.
	unsigned char data[2];
data/rtl-sdr-0.6.0/src/librtlsdr.c:496:11:  [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.
	unsigned char data[2];
data/rtl-sdr-0.6.0/src/librtlsdr.c:518:11:  [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.
	unsigned char data[2];
data/rtl-sdr-0.6.0/src/librtlsdr.c:537:11:  [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.
	unsigned char data[2];
data/rtl-sdr-0.6.0/src/librtlsdr.c:1008: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(gains, ptr, len);
data/rtl-sdr-0.6.0/src/librtlsdr.c:1420: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 str[256];
data/rtl-sdr-0.6.0/src/librtlsdr.c:1456: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(dev->fir, fir_default, sizeof(fir_default));
data/rtl-sdr-0.6.0/src/rtl_adsb.c:347: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(buffer, buf, len);
data/rtl-sdr-0.6.0/src/rtl_adsb.c:391: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).
			ppm_error = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_adsb.c:400:21:  [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).
			allowed_errors = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_adsb.c:454: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).
		file = fopen(filename, "wb");
data/rtl-sdr-0.6.0/src/rtl_biast.c:66: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).
			bias_on = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_biast.c:69: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).
			gpio_pin = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:42: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 manufacturer[MAX_STR_SIZE];
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:43: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 product[MAX_STR_SIZE];
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:44: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 serial[MAX_STR_SIZE];
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:193:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->manufacturer, "Generic");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:194:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->product, "RTL2832U DVB-T");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:204:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->manufacturer, "Realtek");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:205:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->product, "RTL2838UHIDIR");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:206:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->serial, "00000001");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:215:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->manufacturer, "NOXON");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:216:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->product, "DAB Stick");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:226:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->manufacturer, "Realtek");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:227:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->product, "RTL2838UHIDIR");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:228:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->serial, "00000001");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:237:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->manufacturer, "Realtek");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:238:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->product, "RTL2838UHIDIR");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:239:3:  [2] (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). Risk is low because the source is a constant string.
		strcpy(conf->serial, "00000001");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:270: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).
			dev_index = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:285: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).
			ir_endpoint = (atoi(optarg) > 0) ? 1 : -1;
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:356: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).
		file = fopen(filename, flash_file ? "rb" : "wb");
data/rtl-sdr-0.6.0/src/rtl_fm.c:801: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(d->lowpassed, s->buf16, 2*len);
data/rtl-sdr-0.6.0/src/rtl_fm.c:832: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(o->result, d->result, 2*d->result_len);
data/rtl-sdr-0.6.0/src/rtl_fm.c:1110:23:  [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).
			dongle.ppm_error = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_fm.c:1127:26:  [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).
			demod.comp_fir_size = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_fm.c:1238: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).
		output.file = fopen(output.filename, "wb");
data/rtl-sdr-0.6.0/src/rtl_power.c:789: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 t_str[50];
data/rtl-sdr-0.6.0/src/rtl_power.c:841:18:  [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).
			fft_threads = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_power.c:844: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).
			ppm_error = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_power.c:860: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).
			comp_fir_size = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_power.c:952: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).
		file = fopen(filename, "wb");
data/rtl-sdr-0.6.0/src/rtl_sdr.c:140: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).
			ppm_error = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_sdr.c:223: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).
		file = fopen(filename, "wb");
data/rtl-sdr-0.6.0/src/rtl_tcp.c:75: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 magic[4];
data/rtl-sdr-0.6.0/src/rtl_tcp.c:152: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(rpt->data, buf, len);
data/rtl-sdr-0.6.0/src/rtl_tcp.c:382: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 hostinfo[NI_MAXHOST];
data/rtl-sdr-0.6.0/src/rtl_tcp.c:383: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 portinfo[NI_MAXSERV];
data/rtl-sdr-0.6.0/src/rtl_tcp.c:384: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 remhostinfo[NI_MAXHOST];
data/rtl-sdr-0.6.0/src/rtl_tcp.c:385: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 remportinfo[NI_MAXSERV];
data/rtl-sdr-0.6.0/src/rtl_tcp.c:431: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).
			buf_num = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_tcp.c:434: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).
			llbuf_num = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_tcp.c:437: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).
			ppm_error = atoi(optarg);
data/rtl-sdr-0.6.0/src/rtl_tcp.c:546: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(&local, aiHead->ai_addr, aiHead->ai_addrlen);
data/rtl-sdr-0.6.0/src/rtl_tcp.c:605: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(&dongle_info.magic, "RTL0", 4);
data/rtl-sdr-0.6.0/src/rtl_test.c:336: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).
				ppm_duration = atoi(optarg);
data/rtl-sdr-0.6.0/src/tuner_r82xx.c:249: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(&priv->regs[r], val, len);
data/rtl-sdr-0.6.0/src/tuner_r82xx.c:268: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(&priv->buf[1], &val[pos], size);
data/rtl-sdr-0.6.0/src/tuner_r82xx.c:787: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(priv->regs, r82xx_init_array, sizeof(r82xx_init_array));
data/rtl-sdr-0.6.0/src/tuner_r82xx.c:1185: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(priv->regs, r82xx_init_array, sizeof(r82xx_init_array));
data/rtl-sdr-0.6.0/src/convenience/convenience.c:45: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(s);
data/rtl-sdr-0.6.0/src/convenience/convenience.c:74: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(s);
data/rtl-sdr-0.6.0/src/convenience/convenience.c:102: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(s);
data/rtl-sdr-0.6.0/src/convenience/convenience.c:284: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(s, serial, strlen(s)) != 0) {
data/rtl-sdr-0.6.0/src/convenience/convenience.c:294: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).
		offset = strlen(serial) - strlen(s);
data/rtl-sdr-0.6.0/src/convenience/convenience.c:294: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).
		offset = strlen(serial) - strlen(s);
data/rtl-sdr-0.6.0/src/convenience/convenience.c:297:33:  [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(s, serial+offset, strlen(s)) != 0) {
data/rtl-sdr-0.6.0/src/getopt/getopt.c:238: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).
# if (!defined __STDC__ || !__STDC__) && !defined strlen
data/rtl-sdr-0.6.0/src/getopt/getopt.c:241: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).
extern int strlen (const char *);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:432: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).
	      int len = nonoption_flags_max_len = strlen (orig_str);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:660: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).
		== (unsigned int) strlen (p->name))
data/rtl-sdr-0.6.0/src/getopt/getopt.c:687: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).
	  nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:719: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).
		  nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:735: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).
		  nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:740: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).
	  nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:851: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).
	      if ((unsigned int) (nameend - nextchar) == strlen (p->name))
data/rtl-sdr-0.6.0/src/getopt/getopt.c:874: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).
	    nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:894: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).
		    nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:908: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).
		    nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/getopt/getopt.c:912: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).
	    nextchar += strlen (nextchar);
data/rtl-sdr-0.6.0/src/librtlsdr.c:856: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(5000);
data/rtl-sdr-0.6.0/src/librtlsdr.c:1654: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/rtl-sdr-0.6.0/src/rtl_eeprom.c:195:3:  [1] (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). Risk is low because the source is a constant character.
		strcpy(conf->serial, "0");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:217:3:  [1] (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). Risk is low because the source is a constant character.
		strcpy(conf->serial, "0");
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:373:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy((char*)&conf.manufacturer, manuf_str, MAX_STR_SIZE - 1);
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:376:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy((char*)&conf.product, product_str, MAX_STR_SIZE - 1);
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:380:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy((char*)&conf.serial, serial_str, MAX_STR_SIZE - 1);
data/rtl-sdr-0.6.0/src/rtl_eeprom.c:404:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((ch = getchar())) {
data/rtl-sdr-0.6.0/src/rtl_fm.c:64:9:  [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.
#define usleep(x) Sleep(x/1000)
data/rtl-sdr-0.6.0/src/rtl_fm.c:1251: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(100000);
data/rtl-sdr-0.6.0/src/rtl_fm.c:1257: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(100000);
data/rtl-sdr-0.6.0/src/rtl_power.c:55:9:  [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.
#define usleep(x) Sleep(x/1000)
data/rtl-sdr-0.6.0/src/rtl_power.c:546: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(5000);

ANALYSIS SUMMARY:

Hits = 116
Lines analyzed = 13112 in approximately 0.35 seconds (37764 lines/second)
Physical Source Lines of Code (SLOC) = 9292
Hits@level = [0] 281 [1]  33 [2]  62 [3]  18 [4]   3 [5]   0
Hits@level+ = [0+] 397 [1+] 116 [2+]  83 [3+]  21 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 42.7249 [1+] 12.4839 [2+] 8.93241 [3+] 2.26001 [4+] 0.322858 [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.