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/lsyncd-2.2.3/fsevents.c
Examining data/lsyncd-2.2.3/inotify.c
Examining data/lsyncd-2.2.3/lsyncd.c
Examining data/lsyncd-2.2.3/lsyncd.h

FINAL RESULTS:

data/lsyncd-2.2.3/lsyncd.c:1281:3:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		execv( binary, ( char ** ) argv );
data/lsyncd-2.2.3/lsyncd.c:1539: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( entry, dirname );
data/lsyncd-2.2.3/lsyncd.c:1541:4:  [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).
			strcat( entry, de->d_name );
data/lsyncd-2.2.3/lsyncd.h:113:24:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	__attribute__((format(printf, 4, 5)));
data/lsyncd-2.2.3/lsyncd.c:190:9:  [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.
	return realpath( rpath, NULL );
data/lsyncd-2.2.3/lsyncd.c:192:35:  [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.
#	warning having to use old style realpath()
data/lsyncd-2.2.3/lsyncd.c:195: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.
	char *asw = realpath( rpath, buf );
data/lsyncd-2.2.3/fsevents.c:341:6:  [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(&(event->args[whichArg]->data), readbuf + off, argLen);
data/lsyncd-2.2.3/fsevents.c:403: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).
	int fd = open(DEV_FSEVENTS, O_RDONLY);
data/lsyncd-2.2.3/inotify.c:305: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( move_event_buf, event, el );
data/lsyncd-2.2.3/lsyncd.c:194: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[ PATH_MAX] ;
data/lsyncd-2.2.3/lsyncd.c:357: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 ct[ 255 ];
data/lsyncd-2.2.3/lsyncd.c:377: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).
		FILE * flog = fopen( settings.log_file, "a" );
data/lsyncd-2.2.3/lsyncd.c:686: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).
	pidfile_fd = open( pidfile, O_CREAT | O_RDWR, 0644 );
data/lsyncd-2.2.3/lsyncd.c:690: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[ 127 ];
data/lsyncd-2.2.3/lsyncd.c:1320: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( pm->text, pipe_text, pipe_len + 1 );
data/lsyncd-2.2.3/lsyncd.c:2887: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.
main( int argc, char * argv[ ] )
data/lsyncd-2.2.3/fsevents.c:293:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ptrdiff_t len = read (fsevents_fd, readbuf, readbuf_size);
data/lsyncd-2.2.3/inotify.c:436:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			len = read( inotify_fd, readbuf, readbuf_size );
data/lsyncd-2.2.3/lsyncd.c:389:7:  [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).
		ct[ strlen( ct ) - 1] = 0;
data/lsyncd-2.2.3/lsyncd.c:718: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).
	write( pidfile_fd, buf, strlen( buf ) );
data/lsyncd-2.2.3/lsyncd.c:1211:7:  [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( pipe_text ) > 0 )
data/lsyncd-2.2.3/lsyncd.c:1532: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( dirname ) +
data/lsyncd-2.2.3/lsyncd.c:1533: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( de->d_name ) +
data/lsyncd-2.2.3/lsyncd.c:1540:4:  [1] (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). Risk is low because the
  source is a constant character.
			strcat( entry, "/" );

ANALYSIS SUMMARY:

Hits = 25
Lines analyzed = 4112 in approximately 0.10 seconds (41773 lines/second)
Physical Source Lines of Code (SLOC) = 2640
Hits@level = [0]  11 [1]   8 [2]  10 [3]   3 [4]   4 [5]   0
Hits@level+ = [0+]  36 [1+]  25 [2+]  17 [3+]   7 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 13.6364 [1+] 9.4697 [2+] 6.43939 [3+] 2.65152 [4+] 1.51515 [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.