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/teensy-loader-cli-2.1/rebootor/rebootor.c
Examining data/teensy-loader-cli-2.1/rebootor/usb.c
Examining data/teensy-loader-cli-2.1/rebootor/usb.h
Examining data/teensy-loader-cli-2.1/teensy_loader_cli.c

FINAL RESULTS:

data/teensy-loader-cli-2.1/teensy_loader_cli.c:1007:7:  [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.
		r = vprintf(format, ap);
data/teensy-loader-cli-2.1/teensy_loader_cli.c:1028:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, str, ap);
data/teensy-loader-cli-2.1/teensy_loader_cli.c:92: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 buf[2048];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:222: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[128];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:419: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 tmpbuf[1089];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:432: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(tmpbuf + 1, buf, len);
data/teensy-loader-cli-2.1/teensy_loader_cli.c:449:9:  [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[256];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:738: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[256];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:745:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fd = open(buf, O_RDWR);
data/teensy-loader-cli-2.1/teensy_loader_cli.c:831: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 unsigned char firmware_image[MAX_MEMORY_SIZE];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:832: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 unsigned char firmware_mask[MAX_MEMORY_SIZE];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:842: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[1024];
data/teensy-loader-cli-2.1/teensy_loader_cli.c:852:7:  [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).
	fp = fopen(filename, "r");
data/teensy-loader-cli-2.1/teensy_loader_cli.c:292: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(10000);
data/teensy-loader-cli-2.1/teensy_loader_cli.c:676: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(10000);
data/teensy-loader-cli-2.1/teensy_loader_cli.c:892: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).
        if (strlen(line) < 11) return 0;
data/teensy-loader-cli-2.1/teensy_loader_cli.c:896: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).
        if ((int)strlen(line) < (11 + (len * 2)) ) return 0;
data/teensy-loader-cli-2.1/teensy_loader_cli.c:1019: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(seconds * 1000000.0);

ANALYSIS SUMMARY:

Hits = 18
Lines analyzed = 1764 in approximately 0.05 seconds (35947 lines/second)
Physical Source Lines of Code (SLOC) = 1312
Hits@level = [0]  26 [1]   5 [2]  11 [3]   0 [4]   2 [5]   0
Hits@level+ = [0+]  44 [1+]  18 [2+]  13 [3+]   2 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 33.5366 [1+] 13.7195 [2+] 9.90854 [3+] 1.52439 [4+] 1.52439 [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.