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/gscanbus-0.8/debug.c
Examining data/gscanbus-0.8/debug.h
Examining data/gscanbus-0.8/decodeselfid.c
Examining data/gscanbus-0.8/decodeselfid.h
Examining data/gscanbus-0.8/fatal.c
Examining data/gscanbus-0.8/fatal.h
Examining data/gscanbus-0.8/gscanbus.c
Examining data/gscanbus-0.8/icons.c
Examining data/gscanbus-0.8/icons.h
Examining data/gscanbus-0.8/menues.c
Examining data/gscanbus-0.8/menues.h
Examining data/gscanbus-0.8/raw1394support.h
Examining data/gscanbus-0.8/raw1394util.c
Examining data/gscanbus-0.8/raw1394util.h
Examining data/gscanbus-0.8/rominfo.c
Examining data/gscanbus-0.8/rominfo.h
Examining data/gscanbus-0.8/simpleavc.c
Examining data/gscanbus-0.8/simpleavc.h
Examining data/gscanbus-0.8/topologyMap.c
Examining data/gscanbus-0.8/topologyMap.h
Examining data/gscanbus-0.8/topologyTree.c
Examining data/gscanbus-0.8/topologyTree.h

FINAL RESULTS:

data/gscanbus-0.8/decodeselfid.c:187:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(p, "Port %i: %s\n", port_number,
data/gscanbus-0.8/gscanbus.c:96: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(node->label, rom_info->label);
data/gscanbus-0.8/gscanbus.c:99: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(node->label, label);
data/gscanbus-0.8/gscanbus.c:771: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(buf, s);
data/gscanbus-0.8/gscanbus.c:1004:25:  [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, not_compatible);
data/gscanbus-0.8/gscanbus.c:1007:25:  [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, not_loaded);
data/gscanbus-0.8/menues.c:168:4:  [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.
			sscanf(s, format, result);
data/gscanbus-0.8/gscanbus.c:984:7:  [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, optstring);
data/gscanbus-0.8/topologyTree.c:39:10:  [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.
	return (random()/(RAND_MAX/2));
data/gscanbus-0.8/decodeselfid.c:193: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.
	static char buf[34*3+34*8*3+1]; /* 3 Ports + 3*8 Ports + '\0' */
data/gscanbus-0.8/gscanbus.c:101: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(node->label, "Unknown");
data/gscanbus-0.8/gscanbus.c:229:4:  [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(node->label, "Localhost");
data/gscanbus-0.8/gscanbus.c:610: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 descriptors[MAX_DESCRIPTORS];
data/gscanbus-0.8/gscanbus.c:743:29:  [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.
void append_subunit_strings(char *buf, quadlet_t table[8]) {
data/gscanbus-0.8/gscanbus.c:773:4:  [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(buf, ": ");
data/gscanbus-0.8/gscanbus.c:790: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 textualleafes[MAXTEXTLEAFCHARS];
data/gscanbus-0.8/gscanbus.c:793: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 avcstring[MAXAVCSTRINGCHARS];
data/gscanbus-0.8/gscanbus.c:824:4:  [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(avcstring, "Error getting subunit info\n");
data/gscanbus-0.8/gscanbus.c:829: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(avcstring, "N/A\n");
data/gscanbus-0.8/gscanbus.c:988: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).
				else level = atoi(optarg);
data/gscanbus-0.8/gscanbus.c:994: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).
				else port = atoi(optarg);
data/gscanbus-0.8/rominfo.c:85: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 s[MAXLINE+1], description[MAXLINE+1], **pdescription, *pdesc,
data/gscanbus-0.8/rominfo.c:92: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, "r");
data/gscanbus-0.8/rominfo.c:100:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			file = fopen(filename, "r");
data/gscanbus-0.8/rominfo.c:180: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 s[MAXLINE+1], description[MAXLINE+1], **pdescription;
data/gscanbus-0.8/rominfo.c:188: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, "r");
data/gscanbus-0.8/rominfo.c:194:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			file = fopen(filename, "r");
data/gscanbus-0.8/simpleavc.c:50:10:  [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 fcp_response[MAX_RESPONSE_SIZE];
data/gscanbus-0.8/simpleavc.c:94: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(fcp_response, data, length);
data/gscanbus-0.8/topologyTree.h: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				label[256];
data/gscanbus-0.8/decodeselfid.c:189: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).
	return strlen(p);
data/gscanbus-0.8/gscanbus.c:772: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).
			buf += strlen(s);
data/gscanbus-0.8/gscanbus.c:814:5:  [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. Risk is low because the source is a
  constant character.
				strncat(textualleafes, "\n", 1);
data/gscanbus-0.8/gscanbus.c:815:5:  [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(textualleafes, node->rom_info
data/gscanbus-0.8/icons.c:170: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).
	ls1 = strlen(s1);
data/gscanbus-0.8/icons.c:171: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).
	ls2 = strlen(s2);
data/gscanbus-0.8/menues.c:389: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).
				sresult, strlen(sresult));
data/gscanbus-0.8/raw1394util.c:47: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(DELAY);
data/gscanbus-0.8/raw1394util.c:62: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(DELAY);
data/gscanbus-0.8/rominfo.c:143:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(*pdescription, pdesc, pcpu - pdesc);
data/gscanbus-0.8/rominfo.c:237:36:  [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).
			*pdescription = (char *) malloc(strlen(description)+1);
data/gscanbus-0.8/rominfo.c:239:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(*pdescription,description,strlen(description));
data/gscanbus-0.8/rominfo.c:239:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			strncpy(*pdescription,description,strlen(description));
data/gscanbus-0.8/rominfo.c:240: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).
			*(*pdescription + (strlen(description))) = '\0';
data/gscanbus-0.8/simpleavc.c:156: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(10);
data/gscanbus-0.8/simpleavc.c:199: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(10);

ANALYSIS SUMMARY:

Hits = 46
Lines analyzed = 4387 in approximately 0.17 seconds (26209 lines/second)
Physical Source Lines of Code (SLOC) = 2804
Hits@level = [0]  96 [1]  16 [2]  21 [3]   2 [4]   7 [5]   0
Hits@level+ = [0+] 142 [1+]  46 [2+]  30 [3+]   9 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 50.6419 [1+] 16.4051 [2+] 10.699 [3+] 3.2097 [4+] 2.49643 [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.