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/csync2-2.0-25-gc0faaf9/action.c
Examining data/csync2-2.0-25-gc0faaf9/check.c
Examining data/csync2-2.0-25-gc0faaf9/checktxt.c
Examining data/csync2-2.0-25-gc0faaf9/csync2.h
Examining data/csync2-2.0-25-gc0faaf9/cygwin/cs2hintd.c
Examining data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c
Examining data/csync2-2.0-25-gc0faaf9/daemon.c
Examining data/csync2-2.0-25-gc0faaf9/db.c
Examining data/csync2-2.0-25-gc0faaf9/db_api.c
Examining data/csync2-2.0-25-gc0faaf9/db_api.h
Examining data/csync2-2.0-25-gc0faaf9/db_mysql.c
Examining data/csync2-2.0-25-gc0faaf9/db_mysql.h
Examining data/csync2-2.0-25-gc0faaf9/db_postgres.c
Examining data/csync2-2.0-25-gc0faaf9/db_postgres.h
Examining data/csync2-2.0-25-gc0faaf9/db_sqlite.c
Examining data/csync2-2.0-25-gc0faaf9/db_sqlite.h
Examining data/csync2-2.0-25-gc0faaf9/db_sqlite2.c
Examining data/csync2-2.0-25-gc0faaf9/db_sqlite2.h
Examining data/csync2-2.0-25-gc0faaf9/dl.h
Examining data/csync2-2.0-25-gc0faaf9/error.c
Examining data/csync2-2.0-25-gc0faaf9/getrealfn.c
Examining data/csync2-2.0-25-gc0faaf9/groups.c
Examining data/csync2-2.0-25-gc0faaf9/prefixsubst.c
Examining data/csync2-2.0-25-gc0faaf9/update.c
Examining data/csync2-2.0-25-gc0faaf9/urlencode.c
Examining data/csync2-2.0-25-gc0faaf9/csync2.c
Examining data/csync2-2.0-25-gc0faaf9/rsync.c
Examining data/csync2-2.0-25-gc0faaf9/conn.c

FINAL RESULTS:

data/csync2-2.0-25-gc0faaf9/checktxt.c:80:11:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		int r = readlink(filename, tmp, 4095);
data/csync2-2.0-25-gc0faaf9/daemon.c:269:8:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
		rc = chown(filename, buf.st_uid, buf.st_gid);
data/csync2-2.0-25-gc0faaf9/daemon.c:272:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
		rc = chmod(filename, buf.st_mode);
data/csync2-2.0-25-gc0faaf9/daemon.c:699:10:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
				if ( chmod(prefixsubst(tag[2]), atoi(tag[3])) )
data/csync2-2.0-25-gc0faaf9/update.c:430:8:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		rc = readlink(prefixsubst(filename), target, 1023);
data/csync2-2.0-25-gc0faaf9/action.c:96: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(pos, t->value);
data/csync2-2.0-25-gc0faaf9/action.c:100: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(pos, mark+2);
data/csync2-2.0-25-gc0faaf9/action.c:114:3:  [4] (shell) execl:
  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.
		execl("/bin/sh", "sh", "-c", real_command, NULL);
data/csync2-2.0-25-gc0faaf9/check.c:273:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
				sprintf(new_file, "%%%s%%", p->name);
data/csync2-2.0-25-gc0faaf9/check.c:352:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
					sprintf(fn, "%s/%s",
data/csync2-2.0-25-gc0faaf9/check.c:407:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
					sprintf(new_filename, "%%%s%%%s", p->name, filename+p_len);
data/csync2-2.0-25-gc0faaf9/checktxt.c:36:10:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	int t = snprintf(&buffer, 0, ##__VA_ARGS__);	\
data/csync2-2.0-25-gc0faaf9/checktxt.c:38:2:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	snprintf(elements[elidx], t+1, ##__VA_ARGS__);	\
data/csync2-2.0-25-gc0faaf9/conn.c:551:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	c = vsnprintf(b->pos, b->rlen, fmt, ap);
data/csync2-2.0-25-gc0faaf9/conn.c:623:9:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	size = vsnprintf(&dummy, 1, fmt, ap);
data/csync2-2.0-25-gc0faaf9/conn.c:628:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf(buffer, size+1, fmt, ap);
data/csync2-2.0-25-gc0faaf9/csync2.c:434:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (!access(lockfile , F_OK)) {
data/csync2-2.0-25-gc0faaf9/cygwin/cs2hintd.c:88:11:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			pos += sprintf(command+pos, " '%s'", argv[i]);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2hintd.c:89:10:  [4] (shell) popen:
  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.
		fseh = popen(command, "r");
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:62:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-Biiv", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:64:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-iiv", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:70:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-Bcrv", "/", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:72:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-crv", "/", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:78:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-Bcv", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:80:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-Bcv", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:86:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-Bcvr", "/", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:88:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-Bcvr", "/", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:94:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-Buv", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:96:3:  [4] (shell) execl:
  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.
		execl("./csync2.exe", "csync2.exe", "-uv", NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:101:2:  [4] (shell) execl:
  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.
	execl("./cs2hintd.exe", "cs2hintd.exe", dbname,
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:171:3:  [4] (shell) execl:
  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.
		execl("sh", "sh", "-c", command, NULL);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:263: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(buffer[99], timer);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:359:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(vacuum_command, "./sqlite.exe %s vacuum", dbname);
data/csync2-2.0-25-gc0faaf9/db_mysql.c:93:2:  [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(db_url, file);
data/csync2-2.0-25-gc0faaf9/error.c:118:3:  [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(csync_debug_out, fmt, ap);
data/csync2-2.0-25-gc0faaf9/groups.c:96:5:  [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(t, p->pattern);
data/csync2-2.0-25-gc0faaf9/groups.c:137:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
					sprintf(new_file, "%%%s%%%s", p->name, file+p_len);
data/csync2-2.0-25-gc0faaf9/rsync.c:172:7:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
	if (!mktemp(template))
data/csync2-2.0-25-gc0faaf9/update.c:49:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(line, "%s\n", conn_response(CR_ERR_CONN_CLOSED));
data/csync2-2.0-25-gc0faaf9/update.c:909:6:  [4] (shell) popen:
  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.
	p = popen(buffer, "w");
data/csync2-2.0-25-gc0faaf9/csync2.c:429: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.
	systemdir = getenv("CSYNC2_SYSTEM_DIR");
data/csync2-2.0-25-gc0faaf9/csync2.c:439:17:  [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.
	while ( (opt = getopt(argc, argv, "W:s:Ftp:G:P:C:D:N:HBAIXULlSTMRvhcuoimfxrd")) != -1 ) {
data/csync2-2.0-25-gc0faaf9/daemon.c:419: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.
	char *val = getenv(env);
data/csync2-2.0-25-gc0faaf9/rsync.c:195:20:  [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.
		dirs_to_try[2] = getenv("TMPDIR");
data/csync2-2.0-25-gc0faaf9/action.c:90: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(real_command, command_clr, mark-command_clr);
data/csync2-2.0-25-gc0faaf9/action.c:110: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).
		/* 0 */ open("/dev/null", O_RDONLY);
data/csync2-2.0-25-gc0faaf9/action.c:111: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).
		/* 1 */ open(logfile_clr, O_WRONLY|O_CREAT|O_APPEND, 0666);
data/csync2-2.0-25-gc0faaf9/action.c:112: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).
		/* 2 */ open(logfile_clr, O_WRONLY|O_CREAT|O_APPEND, 0666);
data/csync2-2.0-25-gc0faaf9/check.c:46: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 winfilename[MAX_PATH];
data/csync2-2.0-25-gc0faaf9/check.c:174: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 myfilename[dir_len+1];
data/csync2-2.0-25-gc0faaf9/check.c:177: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(myfilename, filename, dir_len);
data/csync2-2.0-25-gc0faaf9/check.c:272:5:  [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_file[strlen(p->name) + 3];
data/csync2-2.0-25-gc0faaf9/check.c:350:6:  [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 fn[strlen(file)+
data/csync2-2.0-25-gc0faaf9/check.c:406:6:  [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_filename[strlen(p->name) + strlen(filename+p_len) + 10];
data/csync2-2.0-25-gc0faaf9/checktxt.c: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 *elements[64];
data/csync2-2.0-25-gc0faaf9/checktxt.c:79: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 tmp[4096];
data/csync2-2.0-25-gc0faaf9/conn.c:140: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 hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
data/csync2-2.0-25-gc0faaf9/conn.c:203: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 hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
data/csync2-2.0-25-gc0faaf9/conn.c:401: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 certdata[2*peercerts[0].size + 1];
data/csync2-2.0-25-gc0faaf9/conn.c:404:4:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
			sprintf(&certdata[2*i], "%02X", peercerts[0].data[i]);
data/csync2-2.0-25-gc0faaf9/conn.c:511: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 buffer[512];
data/csync2-2.0-25-gc0faaf9/conn.c:528: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(buf, buffer+buf_start, real_count);
data/csync2-2.0-25-gc0faaf9/conn.c:566: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 buffer[1024];
data/csync2-2.0-25-gc0faaf9/csync2.c:57:1:  [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 myhostname[256] = "";
data/csync2-2.0-25-gc0faaf9/csync2.c:238: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(filename, O_WRONLY|O_CREAT|O_EXCL, 0600);
data/csync2-2.0-25-gc0faaf9/csync2.c:239: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).
	int rand = open("/dev/urandom", O_RDONLY);
data/csync2-2.0-25-gc0faaf9/csync2.c:241: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 key[64 /* plus newline */ +1];
data/csync2-2.0-25-gc0faaf9/csync2.c:242: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 key_bin[48 /* (sizeof(key)*8)/6 */];
data/csync2-2.0-25-gc0faaf9/csync2.c:325: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 hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
data/csync2-2.0-25-gc0faaf9/csync2.c:379: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 hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
data/csync2-2.0-25-gc0faaf9/csync2.c:443:25:  [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).
				csync_dump_dir_fd = atoi(optarg);
data/csync2-2.0-25-gc0faaf9/csync2.c:449:27:  [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).
				csync_timestamp_out = fopen(optarg, "a");
data/csync2-2.0-25-gc0faaf9/csync2.c:628: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.
		static char line[4 * 4096];
data/csync2-2.0-25-gc0faaf9/csync2.c:677:9:  [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).
	yyin = fopen(file_config, "r");
data/csync2-2.0-25-gc0faaf9/csync2.c:712:5:  [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 *realnames[argc-optind];
data/csync2-2.0-25-gc0faaf9/csync2.c:740:8:  [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).
							atoi(SQL_V(1)));
data/csync2-2.0-25-gc0faaf9/csync2.c:771:5:  [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 *realnames[argc-optind];
data/csync2-2.0-25-gc0faaf9/csync2.c:937:33:  [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).
					printf("%s\t%s\t%s\t%s\n", atoi(SQL_V(0)) ?  "force" : "chary",
data/csync2-2.0-25-gc0faaf9/cygwin/cs2hintd.c:63: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 line[4096], *c;
data/csync2-2.0-25-gc0faaf9/cygwin/cs2hintd.c:86:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		pos = sprintf(command, "./cs2hintd_fseh.exe");
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:37:8:  [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 myhostname[256];
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:235: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 *buffer[100], *timer, ch;
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:286:16:  [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 *f = fopen("cs2monitor.log", "w");
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:358: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 vacuum_command[strlen(dbname) + 100];
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:370: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).
		int rand = open("/dev/urandom", O_RDONLY);
data/csync2-2.0-25-gc0faaf9/daemon.c:108: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 error_buffer[1024];
data/csync2-2.0-25-gc0faaf9/daemon.c:123: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 backup_filename[bak_dir_len + filename_len + 12];
data/csync2-2.0-25-gc0faaf9/daemon.c:124: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 backup_otherfilename[bak_dir_len + filename_len + 12];
data/csync2-2.0-25-gc0faaf9/daemon.c:152:12:  [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_in = open(filename, O_RDONLY);
data/csync2-2.0-25-gc0faaf9/daemon.c:156: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(backup_filename, g->backup_directory, bak_dir_len);
data/csync2-2.0-25-gc0faaf9/daemon.c:187: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(backup_otherfilename, backup_filename, bak_dir_len + filename_len);
data/csync2-2.0-25-gc0faaf9/daemon.c:204: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).
			fd_out = open(backup_filename, O_WRONLY | O_CREAT, 0600);
data/csync2-2.0-25-gc0faaf9/daemon.c:234: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 buffer[512];
data/csync2-2.0-25-gc0faaf9/daemon.c:336: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[INET6_ADDRSTRLEN];
data/csync2-2.0-25-gc0faaf9/daemon.c:441: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(p, result->ai_addr, result->ai_addrlen);
data/csync2-2.0-25-gc0faaf9/daemon.c:445:22:  [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 int setup_tag(char *tag[32], char *line)
data/csync2-2.0-25-gc0faaf9/daemon.c:470:25:  [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 void destroy_tag(char *tag[32])
data/csync2-2.0-25-gc0faaf9/daemon.c:478: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 line[4 * 4096];
data/csync2-2.0-25-gc0faaf9/daemon.c:560:7:  [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 parent_dirname[strlen(tag[2])];
data/csync2-2.0-25-gc0faaf9/daemon.c:588:15:  [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 *f = fopen(prefixsubst(tag[2]), "rb");
data/csync2-2.0-25-gc0faaf9/daemon.c:591: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).
					f = fopen("/dev/null", "rb");
data/csync2-2.0-25-gc0faaf9/daemon.c:594:6:  [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 buffer[512];
data/csync2-2.0-25-gc0faaf9/daemon.c:650:5:  [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 winfilename[MAX_PATH];
data/csync2-2.0-25-gc0faaf9/daemon.c:671:50:  [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 ( mknod(prefixsubst(tag[2]), 0700|S_IFCHR, atoi(tag[3])) )
data/csync2-2.0-25-gc0faaf9/daemon.c:675:50:  [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 ( mknod(prefixsubst(tag[2]), 0700|S_IFBLK, atoi(tag[3])) )
data/csync2-2.0-25-gc0faaf9/daemon.c:691:39:  [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).
				int uid = csync_ignore_uid ? -1 : atoi(tag[3]);
data/csync2-2.0-25-gc0faaf9/daemon.c:692:39:  [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).
				int gid = csync_ignore_gid ? -1 : atoi(tag[4]);
data/csync2-2.0-25-gc0faaf9/daemon.c:699:37:  [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 ( chmod(prefixsubst(tag[2]), atoi(tag[3])) )
data/csync2-2.0-25-gc0faaf9/daemon.c:727:25:  [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).
				csync_debug_level = atoi(tag[1]);
data/csync2-2.0-25-gc0faaf9/db_api.c:93:11:  [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).
		*port = atoi(pos + 1);
data/csync2-2.0-25-gc0faaf9/db_mysql.c:274:10:  [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).
		return atoi(value);
data/csync2-2.0-25-gc0faaf9/db_postgres.c:327:9:  [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).
	return atoi(f.PQgetvalue_fn(result, *row_p, column));
data/csync2-2.0-25-gc0faaf9/db_sqlite2.c:191:11:  [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).
		value = atoi(str_value);
data/csync2-2.0-25-gc0faaf9/error.c:42: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 ftbuffer[128];
data/csync2-2.0-25-gc0faaf9/error.c:90: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 ftbuffer[32];
data/csync2-2.0-25-gc0faaf9/getrealfn.c:34: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(r, "/__PATH_TO_LONG__");
data/csync2-2.0-25-gc0faaf9/getrealfn.c:111: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).
		int cwdfd = open(".", O_RDONLY);
data/csync2-2.0-25-gc0faaf9/groups.c:94:5:  [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 t[strlen(p->pattern)+1], *l;
data/csync2-2.0-25-gc0faaf9/groups.c:136:6:  [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_file[strlen(p->name) + strlen(file+p_len) + 10];
data/csync2-2.0-25-gc0faaf9/prefixsubst.c:26:8:  [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 *ringbuff[RINGBUFF_LEN];
data/csync2-2.0-25-gc0faaf9/rsync.c:64:17:  [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(d, s, len);
data/csync2-2.0-25-gc0faaf9/rsync.c:115: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 temp[MAXPATHLEN];
data/csync2-2.0-25-gc0faaf9/rsync.c:156:12:  [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).
		int fd = mkstemp(template);
data/csync2-2.0-25-gc0faaf9/rsync.c:174:9:  [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).
	return open(template, O_RDWR|O_EXCL|O_CREAT | O_BINARY, perms);
data/csync2-2.0-25-gc0faaf9/rsync.c:317: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(suf, TMPNAME_SUFFIX, TMPNAME_SUFFIX_LEN+1);
data/csync2-2.0-25-gc0faaf9/rsync.c:373: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 buffer[512];
data/csync2-2.0-25-gc0faaf9/rsync.c:401: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 buffer[512];
data/csync2-2.0-25-gc0faaf9/rsync.c:444: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 tmpfname[MAXPATHLEN];
data/csync2-2.0-25-gc0faaf9/rsync.c:455:15:  [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).
	basis_file = fopen(prefixsubst(filename), "rb");
data/csync2-2.0-25-gc0faaf9/rsync.c:498: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 buffer1[512], buffer2[512];
data/csync2-2.0-25-gc0faaf9/rsync.c:627: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 tmpfname[MAXPATHLEN];
data/csync2-2.0-25-gc0faaf9/rsync.c:646: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).
	new_file = fopen(prefixsubst(filename), "rb");
data/csync2-2.0-25-gc0faaf9/rsync.c:700: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 tmpfname[MAXPATHLEN], newfname[MAXPATHLEN];
data/csync2-2.0-25-gc0faaf9/rsync.c:711:15:  [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).
	basis_file = fopen(prefixsubst(filename), "rb");
data/csync2-2.0-25-gc0faaf9/rsync.c:740: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 winfilename[MAX_PATH];
data/csync2-2.0-25-gc0faaf9/rsync.c:766: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 buffer[512];
data/csync2-2.0-25-gc0faaf9/rsync.c:777:16:  [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).
		basis_file = fopen(prefixsubst(filename), "wb");
data/csync2-2.0-25-gc0faaf9/update.c:38: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 line[4096];
data/csync2-2.0-25-gc0faaf9/update.c:178: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.
		static char chk1[4 * 4096];
data/csync2-2.0-25-gc0faaf9/update.c:330: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.
		static char chk1[4 * 4096];
data/csync2-2.0-25-gc0faaf9/update.c:428: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 target[1024];
data/csync2-2.0-25-gc0faaf9/update.c:520: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.
					static char buffer[4 * 4096];
data/csync2-2.0-25-gc0faaf9/update.c:540:19:  [2] (integer) atol:
  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).
					remotedata = atol(buffer);
data/csync2-2.0-25-gc0faaf9/update.c:685: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 parent_dirname[filename_length];
data/csync2-2.0-25-gc0faaf9/update.c:729:55:  [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).
			textlist_add2(&tl, filename, url_decode(SQL_V(1)), atoi(SQL_V(2)));
data/csync2-2.0-25-gc0faaf9/update.c:862: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 buffer[512];
data/csync2-2.0-25-gc0faaf9/update.c:927: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 inbuf[2048], *tmp;
data/csync2-2.0-25-gc0faaf9/urlencode.c:28:8:  [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 *ringbuff[RINGBUFF_LEN];
data/csync2-2.0-25-gc0faaf9/urlencode.c:70: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 *out, num[3]="XX";
data/csync2-2.0-25-gc0faaf9/action.c:83: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(command_clr) + 10;
data/csync2-2.0-25-gc0faaf9/action.c:87: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).
			len += strlen(t->value) + 1;
data/csync2-2.0-25-gc0faaf9/action.c:94: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).
			pos += strlen(pos);
data/csync2-2.0-25-gc0faaf9/action.c:99:10:  [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).
		pos += strlen(pos);
data/csync2-2.0-25-gc0faaf9/action.c:102:10:  [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).
		assert(strlen(real_command)+1 < len);
data/csync2-2.0-25-gc0faaf9/check.c:43:46:  [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 (!strncmp(filename, "/cygdrive/", 10) && strlen(filename) == 11)
data/csync2-2.0-25-gc0faaf9/check.c:49: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).
	int winfilename_len = strlen(winfilename);
data/csync2-2.0-25-gc0faaf9/check.c:60:19:  [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).
	found_file_len = strlen(fd.cFileName);
data/csync2-2.0-25-gc0faaf9/check.c:272:19:  [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).
				char new_file[strlen(p->name) + 3];
data/csync2-2.0-25-gc0faaf9/check.c:280:20:  [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 file_len = strlen(file);
data/csync2-2.0-25-gc0faaf9/check.c:281:20:  [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 path_len = strlen(p->path);
data/csync2-2.0-25-gc0faaf9/check.c:350: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).
					char fn[strlen(file)+
data/csync2-2.0-25-gc0faaf9/check.c:351: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).
						strlen(namelist[n]->d_name)+2];
data/csync2-2.0-25-gc0faaf9/check.c:363: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).
			int written = 0, len = strlen(file)+1;
data/csync2-2.0-25-gc0faaf9/check.c:401: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).
				int p_len = strlen(p->path);
data/csync2-2.0-25-gc0faaf9/check.c:402: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).
				int f_len = strlen(filename);
data/csync2-2.0-25-gc0faaf9/check.c:406: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).
					char new_filename[strlen(p->name) + strlen(filename+p_len) + 10];
data/csync2-2.0-25-gc0faaf9/check.c:406:42:  [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).
					char new_filename[strlen(p->name) + strlen(filename+p_len) + 10];
data/csync2-2.0-25-gc0faaf9/conn.c:94: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).
			__response_len[j] = strlen(__response[j] ?: "");
data/csync2-2.0-25-gc0faaf9/conn.c:477:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		return read(conn_fd_in, buf, count);
data/csync2-2.0-25-gc0faaf9/csync2.c:255:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	rc = read(rand, key_bin, sizeof(key_bin));
data/csync2-2.0-25-gc0faaf9/cygwin/cs2hintd.c:83:19:  [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).
			command_len += strlen(argv[i]) + 10;
data/csync2-2.0-25-gc0faaf9/cygwin/cs2hintd.c:103: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(line) < 3) continue;
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:251:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			while (read(0, &ch, 1) == 1)
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:264: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).
					epos = strlen(timer);
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:358: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).
		char vacuum_command[strlen(dbname) + 100];
data/csync2-2.0-25-gc0faaf9/cygwin/cs2monitor.c:371:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		read(rand, &random_number, sizeof(unsigned char));
data/csync2-2.0-25-gc0faaf9/daemon.c:118: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).
	int filename_len = strlen(filename);	//can filename be null?
data/csync2-2.0-25-gc0faaf9/daemon.c:122: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).
			unsigned int bak_dir_len = strlen(g->backup_directory);
data/csync2-2.0-25-gc0faaf9/daemon.c:235:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	int read_len = read(fd_in, buffer, 512);
data/csync2-2.0-25-gc0faaf9/daemon.c:251:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		read_len = read(fd_in, buffer, 512);
data/csync2-2.0-25-gc0faaf9/daemon.c:560: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).
						char parent_dirname[strlen(tag[2])];
data/csync2-2.0-25-gc0faaf9/daemon.c:767: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).
					gnamelen = strlen(csync_group->gname);
data/csync2-2.0-25-gc0faaf9/db_api.c:36:42:  [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 (!strncmp(*db_str, db_types[index], strlen(db_types[index]))) {
data/csync2-2.0-25-gc0faaf9/db_api.c:37: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).
			*db_str += strlen(db_types[index]);
data/csync2-2.0-25-gc0faaf9/db_api.c:123: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).
			size_t len = strlen(db_str);
data/csync2-2.0-25-gc0faaf9/db_mysql.c:87: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).
	char *db_url = malloc(strlen(file) + 1);
data/csync2-2.0-25-gc0faaf9/db_sqlite.c:169:51:  [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).
	rc = f.sqlite3_prepare_v2_fn(conn->private, sql, strlen(sql), &sqlite_stmt, (const char **)pptail);
data/csync2-2.0-25-gc0faaf9/getrealfn.c:66: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).
		char *tmp = tempfn + strlen(tempfn) - 1;
data/csync2-2.0-25-gc0faaf9/getrealfn.c:132: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(tempfn);
data/csync2-2.0-25-gc0faaf9/groups.c:94:12:  [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).
				char t[strlen(p->pattern)+1], *l;
data/csync2-2.0-25-gc0faaf9/groups.c:126: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).
				int p_len = strlen(p->path);
data/csync2-2.0-25-gc0faaf9/groups.c:127: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).
				int f_len = strlen(file);
data/csync2-2.0-25-gc0faaf9/groups.c:136:20:  [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).
					char new_file[strlen(p->name) + strlen(file+p_len) + 10];
data/csync2-2.0-25-gc0faaf9/groups.c:136: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).
					char new_file[strlen(p->name) + strlen(file+p_len) + 10];
data/csync2-2.0-25-gc0faaf9/prefixsubst.c:45: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(p->name) == pn_len && !strncmp(p->name, pn, pn_len) && p->path) {
data/csync2-2.0-25-gc0faaf9/prefixsubst.c:74: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).
				int p_len = strlen(p->path);
data/csync2-2.0-25-gc0faaf9/prefixsubst.c:75: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).
				int f_len = strlen(filename);
data/csync2-2.0-25-gc0faaf9/rsync.c:59:22:  [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).
        size_t len = strlen(s);
data/csync2-2.0-25-gc0faaf9/rsync.c:91:12:  [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).
	pathlen = strlen(filepath);
data/csync2-2.0-25-gc0faaf9/rsync.c:92:12:  [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).
	baselen = strlen(base);
data/csync2-2.0-25-gc0faaf9/rsync.c:126:20:  [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).
	strlcpy(temp,path,strlen(path));
data/csync2-2.0-25-gc0faaf9/update.c:662: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).
	skip_subtree_len = skip_subtree ? strlen(skip_subtree) : 0;
data/csync2-2.0-25-gc0faaf9/update.c:684: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).
			int filename_length = strlen(t->value);
data/csync2-2.0-25-gc0faaf9/update.c:696: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).
				skip_subtree_len = strlen(skip_subtree);
data/csync2-2.0-25-gc0faaf9/update.c:838: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).
			int i=0, pnamelen = strlen(t->value);

ANALYSIS SUMMARY:

Hits = 205
Lines analyzed = 9051 in approximately 0.33 seconds (27544 lines/second)
Physical Source Lines of Code (SLOC) = 6860
Hits@level = [0] 112 [1]  56 [2] 105 [3]   4 [4]  35 [5]   5
Hits@level+ = [0+] 317 [1+] 205 [2+] 149 [3+]  44 [4+]  40 [5+]   5
Hits/KSLOC@level+ = [0+] 46.2099 [1+] 29.8834 [2+] 21.7201 [3+] 6.41399 [4+] 5.8309 [5+] 0.728863
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.