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/rrdcollect-0.2.10/include/rrdcollect.h
Examining data/rrdcollect-0.2.10/src/rrdcollect.c
Examining data/rrdcollect-0.2.10/src/counters.c
Examining data/rrdcollect-0.2.10/src/checkpid.c
Examining data/rrdcollect-0.2.10/src/parse.c
Examining data/rrdcollect-0.2.10/src/scan.c
Examining data/rrdcollect-0.2.10/src/log.c
Examining data/rrdcollect-0.2.10/src/getopt.h
Examining data/rrdcollect-0.2.10/src/getopt1.c
Examining data/rrdcollect-0.2.10/src/getopt.c

FINAL RESULTS:

data/rrdcollect-0.2.10/src/counters.c:57: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(rrd[i]->rrdtemplate, name);
data/rrdcollect-0.2.10/src/counters.c:121:12:  [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.
			input = popen(test[i]->uri->path, "r");
data/rrdcollect-0.2.10/src/log.c:63: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(stderr,fmt,ap);
data/rrdcollect-0.2.10/src/log.c:74:5:  [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(stderr,fmt,ap);
data/rrdcollect-0.2.10/src/rrdcollect.c:74:3:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		fprintf(rrdtool, (i) ? " %s" : "%s", argv[i]);
data/rrdcollect-0.2.10/src/rrdcollect.c:111: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(logbuffer,argv[i]);
data/rrdcollect-0.2.10/src/rrdcollect.c:197:3:  [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.
		printf(PACKAGE_STRING
data/rrdcollect-0.2.10/src/rrdcollect.c:227:2:  [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.
	printf(PACKAGE_STRING "  --  Round-Robin Database Collecting Daemon.\n");
data/rrdcollect-0.2.10/src/rrdcollect.c:386:14:  [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.
			rrdtool = popen(output_pipe, "w");
data/rrdcollect-0.2.10/src/getopt.c:218:9:  [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.
#ifndef getenv
data/rrdcollect-0.2.10/src/getopt.c:219: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.
extern char *getenv ();
data/rrdcollect-0.2.10/src/getopt.c:404:21:  [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.
  posixly_correct = getenv ("POSIXLY_CORRECT");
data/rrdcollect-0.2.10/src/getopt.c:1194:1:  [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.
getopt (argc, argv, optstring)
data/rrdcollect-0.2.10/src/getopt.c:1224:11:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
      c = getopt (argc, argv, "abc:d:0123456789");
data/rrdcollect-0.2.10/src/getopt.h:145:12:  [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.
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
data/rrdcollect-0.2.10/src/getopt.h:147:12:  [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.
extern int getopt ();
data/rrdcollect-0.2.10/src/getopt.h:151:12:  [3] (buffer) getopt_long:
  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.
extern int getopt_long (int ___argc, char *const *___argv,
data/rrdcollect-0.2.10/src/getopt.h:165:12:  [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.
extern int getopt ();
data/rrdcollect-0.2.10/src/getopt.h:167:12:  [3] (buffer) getopt_long:
  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.
extern int getopt_long ();
data/rrdcollect-0.2.10/src/getopt1.c:71:1:  [3] (buffer) getopt_long:
  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.
getopt_long (argc, argv, options, long_options, opt_index)
data/rrdcollect-0.2.10/src/getopt1.c:98:18:  [3] (buffer) getopt_long:
  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.
libc_hidden_def (getopt_long)
data/rrdcollect-0.2.10/src/getopt1.c:131:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
      c = getopt_long (argc, argv, "abc:d:0123456789",
data/rrdcollect-0.2.10/src/rrdcollect.c:298:7:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		c = getopt_long(argc, argv, "vnc:o:pVh",
data/rrdcollect-0.2.10/include/rrdcollect.h:222: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.
extern char buf[8192];
data/rrdcollect-0.2.10/src/checkpid.c:47: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).
	pidfd=open(pid_file,
data/rrdcollect-0.2.10/src/checkpid.c:51: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).
	pidfd=open(pid_file,
data/rrdcollect-0.2.10/src/checkpid.c:93: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 pid_string[PID_LENGTH];
data/rrdcollect-0.2.10/src/counters.c:87: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(test[i]->uri, uri, sizeof(struct uri_t));
data/rrdcollect-0.2.10/src/counters.c:124:12:  [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).
			input = fopen(test[i]->uri->path, "r");
data/rrdcollect-0.2.10/src/counters.c:201: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.
		bp += sprintf(bp, "%ld", time(NULL));
data/rrdcollect-0.2.10/src/parse.c:26: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 buf[8192];
data/rrdcollect-0.2.10/src/parse.c:251:16:  [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).
		match.line = atoi(pat);
data/rrdcollect-0.2.10/src/parse.c:357: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(test->match[i], &match, sizeof(struct match_t));
data/rrdcollect-0.2.10/src/parse.c:372: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 *conf = fopen(conf_file, "r");
data/rrdcollect-0.2.10/src/rrdcollect.c:87: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 logbuffer[MAX_LOG_BUF_LEN];
data/rrdcollect-0.2.10/src/rrdcollect.c:101:5:  [2] (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 string.
				strcat(logbuffer," : ");
data/rrdcollect-0.2.10/src/rrdcollect.c:173:12:  [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).
				step = atoi(value);
data/rrdcollect-0.2.10/src/rrdcollect.c:377: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).
				rrdtool = fopen(output_file, "a");
data/rrdcollect-0.2.10/src/rrdcollect.c:419:3:  [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).
		open("/dev/null",O_RDWR);
data/rrdcollect-0.2.10/src/scan.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 dec[21];
data/rrdcollect-0.2.10/src/scan.c:71:16:  [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).
						length = atoi(fmt);
data/rrdcollect-0.2.10/src/scan.c:109:31:  [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((start == buf) || ((atoi(start) == '-') && (buf-start == 1)))
data/rrdcollect-0.2.10/src/checkpid.c:103:67:  [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).
	send_log(LOG_DEBUG,"Write PID %s(%d) to file fd=%d\n",pid_string,strlen(pid_string),pidfd);
data/rrdcollect-0.2.10/src/checkpid.c:104: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).
	res=write(pidfd,(void*)pid_string,strlen(pid_string));
data/rrdcollect-0.2.10/src/counters.c:53: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).
			len = strlen(rrd[i]->rrdtemplate);
data/rrdcollect-0.2.10/src/counters.c:54: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(name) + 2;
data/rrdcollect-0.2.10/src/counters.c:56: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(rrd[i]->rrdtemplate, ":");
data/rrdcollect-0.2.10/src/getopt.c:241: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).
# if (!defined __STDC__ || !__STDC__) && !defined strlen
data/rrdcollect-0.2.10/src/getopt.c:244: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).
extern int strlen (const char *);
data/rrdcollect-0.2.10/src/getopt.c:435:44:  [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 = nonoption_flags_max_len = strlen (orig_str);
data/rrdcollect-0.2.10/src/getopt.c:663: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).
		== (unsigned int) strlen (p->name))
data/rrdcollect-0.2.10/src/getopt.c:708:16:  [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).
	  nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/getopt.c:774: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).
		  nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/getopt.c:808: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).
		  nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/getopt.c:813:16:  [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).
	  nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/getopt.c:1000: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).
	      if ((unsigned int) (nameend - nextchar) == strlen (p->name))
data/rrdcollect-0.2.10/src/getopt.c:1040:18:  [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).
	    nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/getopt.c:1078: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).
		    nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/getopt.c:1110: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).
		    nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/getopt.c:1114:18:  [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).
	    nextchar += strlen (nextchar);
data/rrdcollect-0.2.10/src/rrdcollect.c:97: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(logbuffer)+3>=MAX_LOG_BUF_LEN) {
data/rrdcollect-0.2.10/src/rrdcollect.c:107:6:  [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(logbuffer)+strlen(argv[i])>=MAX_LOG_BUF_LEN) {
data/rrdcollect-0.2.10/src/rrdcollect.c:107: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).
		if(strlen(logbuffer)+strlen(argv[i])>=MAX_LOG_BUF_LEN) {
data/rrdcollect-0.2.10/src/scan.c:260:64:  [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 rc = pcre_exec(match->regex.code, match->regex.extra, bp, strlen(bp), 0, 0, match->regex.ovector, (match->count+1) * 3);

ANALYSIS SUMMARY:

Hits = 64
Lines analyzed = 3493 in approximately 0.12 seconds (29011 lines/second)
Physical Source Lines of Code (SLOC) = 2330
Hits@level = [0]  63 [1]  22 [2]  19 [3]  14 [4]   9 [5]   0
Hits@level+ = [0+] 127 [1+]  64 [2+]  42 [3+]  23 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 54.5064 [1+] 27.4678 [2+] 18.0258 [3+] 9.87124 [4+] 3.86266 [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.