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/archivemount-0.8.7/archivemount.c
Examining data/archivemount-0.8.7/archivecomp.h
Examining data/archivemount-0.8.7/uthash.h

FINAL RESULTS:

data/archivemount-0.8.7/archivemount.c:356:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
				sprintf( tempnode->name, "%s/%s", last->name, nam );
data/archivemount-0.8.7/archivemount.c:358:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
				sprintf( tempnode->name, "/%s", nam );
data/archivemount-0.8.7/archivemount.c:422: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( subtree_filter, PREFIX );
data/archivemount-0.8.7/archivemount.c:423:20:  [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).
		subtree_filter = strcat( subtree_filter, options.subtree_filter );
data/archivemount-0.8.7/archivemount.c:525:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf( cur->name, "/%s", name );
data/archivemount-0.8.7/archivemount.c:703:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf( newName, "/%s%s", to, individualName );
data/archivemount-0.8.7/archivemount.c:710:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf( newName, "%s%s", to, individualName );
data/archivemount-0.8.7/archivemount.c:740:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf( *location, "%s/archivemount%s_XXXXXX", P_tmpdir, tmppath );
data/archivemount-0.8.7/archivemount.c:881:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf( oldfilename, "%s.orig", archiveFile );
data/archivemount-0.8.7/archivemount.c:2407:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf( temp_name, "/%s", to );
data/archivemount-0.8.7/uthash.h:250:29:  [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 HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)
data/archivemount-0.8.7/archivemount.c:1099:14:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	const char *realpath;
data/archivemount-0.8.7/archivemount.c:1153:15:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		if( strcmp( realpath, name ) == 0 ) {
data/archivemount-0.8.7/archivemount.c:1244:14:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	const char *realpath;
data/archivemount-0.8.7/archivemount.c:1325:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
			if( strcmp( realpath, name ) == 0 ) {
data/archivemount-0.8.7/archivemount.c:1399:14:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	const char *realpath;
data/archivemount-0.8.7/archivemount.c:1450:15:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
		if( strcmp( realpath, name ) == 0 ) {
data/archivemount-0.8.7/archivemount.c:66:13:  [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 *FH = fopen( "/tmp/archivemount.log", "a" ); \
data/archivemount-0.8.7/archivemount.c:332: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 nam[namlen + 1];
data/archivemount-0.8.7/archivemount.c:412: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 error_buffer[256];
data/archivemount-0.8.7/archivemount.c:742:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	if( ( fh = mkstemp( *location ) == -1 ) ) {
data/archivemount-0.8.7/archivemount.c:807: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).
		fh = open( node->location, O_RDONLY );
data/archivemount-0.8.7/archivemount.c:894:15:  [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).
		archiveFd = open( archiveFile, O_RDONLY );
data/archivemount-0.8.7/archivemount.c:897:14:  [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).
	archiveFd = open( oldfilename, O_RDONLY );
data/archivemount-0.8.7/archivemount.c:981:13:  [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).
	tempfile = open( archiveFile,
data/archivemount-0.8.7/archivemount.c:1074:14:  [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).
	archiveFd = open( archiveFile, O_RDONLY );
data/archivemount-0.8.7/archivemount.c:1266: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).
		fh = open( node->location, O_RDONLY );
data/archivemount-0.8.7/archivemount.c:1512: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( stbuf, archive_entry_stat( node->entry ),
data/archivemount-0.8.7/archivemount.c:1893:14:  [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).
		if( ( fh = open( location, O_WRONLY ) ) == -1 ) {
data/archivemount-0.8.7/archivemount.c:1908:14:  [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).
		if( ( fh = open( location, O_WRONLY | O_CREAT | O_EXCL,
data/archivemount-0.8.7/archivemount.c:2031:14:  [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).
		if( ( fh = open( location, O_WRONLY ) ) == -1 ) {
data/archivemount-0.8.7/archivemount.c:2045:14:  [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).
		if( ( fh = open( location, O_WRONLY | O_CREAT | O_EXCL,
data/archivemount-0.8.7/archivemount.c:2729:15:  [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).
		archiveFd = open( archiveFile, O_RDWR );
data/archivemount-0.8.7/archivemount.c:2740:14:  [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).
	archiveFd = open( archiveFile, O_RDONLY );
data/archivemount-0.8.7/archivemount.c:2759: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).
	oldpwd = open( ".", 0 );
data/archivemount-0.8.7/archivemount.c:313:54:  [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).
	HASH_ADD_KEYPTR( hh, parent->child, node->basename, strlen(node->basename), node );
data/archivemount-0.8.7/archivemount.c:335:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy( nam, key, namlen );
data/archivemount-0.8.7/archivemount.c:351:5:  [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( last->name ) + namlen + 2 ) ) == NULL ) {
data/archivemount-0.8.7/archivemount.c:380:45:  [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).
		HASH_FIND(hh, cur->child, node->basename, strlen(node->basename), tempnode);
data/archivemount-0.8.7/archivemount.c:417: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).
		subtree_filter = malloc(strlen(options.subtree_filter) + strlen(PREFIX) + 1);
data/archivemount-0.8.7/archivemount.c:417:60:  [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).
		subtree_filter = malloc(strlen(options.subtree_filter) + strlen(PREFIX) + 1);
data/archivemount-0.8.7/archivemount.c:521: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).
			if( (cur->name = malloc( strlen( name ) + 2 ) ) == NULL ) {
data/archivemount-0.8.7/archivemount.c:530: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).
		int len = strlen(cur->name) - 1;
data/archivemount-0.8.7/archivemount.c:632: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).
		basename = path + strlen(start->name) - (*path=='/'?0:1);
data/archivemount-0.8.7/archivemount.c:696: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).
		individualName = node->name + strlen( from );
data/archivemount-0.8.7/archivemount.c:698: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).
			if( ( newName = ( char * )malloc( strlen( to ) +
data/archivemount-0.8.7/archivemount.c:699:5:  [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( individualName ) + 2 ) ) == NULL ) {
data/archivemount-0.8.7/archivemount.c:705: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).
			if( ( newName = ( char * )malloc( strlen( to ) +
data/archivemount-0.8.7/archivemount.c:706:5:  [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( individualName ) + 1 ) ) == NULL ) {
data/archivemount-0.8.7/archivemount.c:734:4:  [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( P_tmpdir ) +
data/archivemount-0.8.7/archivemount.c:735:4:  [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( "_archivemount" ) +
data/archivemount-0.8.7/archivemount.c:736:4:  [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( tmppath ) + 8 ) ) == NULL ) {
data/archivemount-0.8.7/archivemount.c:873: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).
	oldfilename = malloc( strlen( archiveFile ) + 5 + 1 );
data/archivemount-0.8.7/archivemount.c:1642: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( node->name[strlen(node->name)-1] == '.' ) {
data/archivemount-0.8.7/archivemount.c:1704:15:  [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).
	st.st_size = strlen( from );
data/archivemount-0.8.7/archivemount.c:2402: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).
		if( ( temp_name = malloc( strlen( to ) + 2 ) ) == NULL ) {
data/archivemount-0.8.7/uthash.h:232:31:  [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).
    HASH_FIND(hh,head,findstr,strlen(findstr),out)
data/archivemount-0.8.7/uthash.h:234:31:  [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).
    HASH_ADD(hh,head,strfield,strlen(add->strfield),add)

ANALYSIS SUMMARY:

Hits = 58
Lines analyzed = 3781 in approximately 0.11 seconds (35626 lines/second)
Physical Source Lines of Code (SLOC) = 3039
Hits@level = [0]  19 [1]  23 [2]  18 [3]   6 [4]  11 [5]   0
Hits@level+ = [0+]  77 [1+]  58 [2+]  35 [3+]  17 [4+]  11 [5+]   0
Hits/KSLOC@level+ = [0+] 25.3373 [1+] 19.0852 [2+] 11.5169 [3+] 5.59395 [4+] 3.61961 [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.