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/usbrelay-0.4/usbrelay.c
Examining data/usbrelay-0.4/usbrelay.h

FINAL RESULTS:

data/usbrelay-0.4/usbrelay.c:60:10:  [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(relays[i].this_serial,token);
data/usbrelay-0.4/usbrelay.c:69:6:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	    strcpy(relays[i].new_serial,token);
data/usbrelay-0.4/usbrelay.c:84: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.
   product = getenv("USBID");
data/usbrelay-0.4/usbrelay.c:32:13:  [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[9];// 1 extra byte for the report ID
data/usbrelay-0.4/usbrelay.c:33: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 arg_t[20] = {'\0'};
data/usbrelay-0.4/usbrelay.c:64:32:  [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).
         relays[i].relay_num = atoi(token);
data/usbrelay-0.4/usbrelay.c:73: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).
            if (atoi(token)) {
data/usbrelay-0.4/usbrelay.c:106: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).
      num_relays = atoi((const char *)&cur_dev->product_string[8] );
data/usbrelay-0.4/usbrelay.c:172:13:  [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[9];// 1 extra byte for the report ID
data/usbrelay-0.4/usbrelay.c:193:13:  [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[9];// 1 extra byte for the report ID
data/usbrelay-0.4/usbrelay.h:29: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 this_serial[10];
data/usbrelay-0.4/usbrelay.h:33: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 new_serial[10];
data/usbrelay-0.4/usbrelay.c:56:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(arg_t,argv[i],19);

ANALYSIS SUMMARY:

Hits = 13
Lines analyzed = 247 in approximately 0.02 seconds (13604 lines/second)
Physical Source Lines of Code (SLOC) = 180
Hits@level = [0]  22 [1]   1 [2]   9 [3]   1 [4]   2 [5]   0
Hits@level+ = [0+]  35 [1+]  13 [2+]  12 [3+]   3 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 194.444 [1+] 72.2222 [2+] 66.6667 [3+] 16.6667 [4+] 11.1111 [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.