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/pkgconf-1.6.3/libpkgconf/libpkgconf-api.h
Examining data/pkgconf-1.6.3/libpkgconf/personality.c
Examining data/pkgconf-1.6.3/libpkgconf/path.c
Examining data/pkgconf-1.6.3/libpkgconf/bsdstubs.h
Examining data/pkgconf-1.6.3/libpkgconf/parser.c
Examining data/pkgconf-1.6.3/libpkgconf/pkg.c
Examining data/pkgconf-1.6.3/libpkgconf/audit.c
Examining data/pkgconf-1.6.3/libpkgconf/argvsplit.c
Examining data/pkgconf-1.6.3/libpkgconf/win-dirent.h
Examining data/pkgconf-1.6.3/libpkgconf/fileio.c
Examining data/pkgconf-1.6.3/libpkgconf/fragment.c
Examining data/pkgconf-1.6.3/libpkgconf/tuple.c
Examining data/pkgconf-1.6.3/libpkgconf/queue.c
Examining data/pkgconf-1.6.3/libpkgconf/cache.c
Examining data/pkgconf-1.6.3/libpkgconf/libpkgconf.h
Examining data/pkgconf-1.6.3/libpkgconf/client.c
Examining data/pkgconf-1.6.3/libpkgconf/bsdstubs.c
Examining data/pkgconf-1.6.3/libpkgconf/stdinc.h
Examining data/pkgconf-1.6.3/libpkgconf/dependency.c
Examining data/pkgconf-1.6.3/libpkgconf/iter.h
Examining data/pkgconf-1.6.3/cli/main.c
Examining data/pkgconf-1.6.3/cli/renderer-msvc.c
Examining data/pkgconf-1.6.3/cli/renderer-msvc.h
Examining data/pkgconf-1.6.3/cli/getopt_long.c
Examining data/pkgconf-1.6.3/cli/getopt_long.h

FINAL RESULTS:

data/pkgconf-1.6.3/cli/getopt_long.c:262:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
			fprintf(stderr, ambig,
data/pkgconf-1.6.3/cli/getopt_long.c:278:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				fprintf(stderr, noarg,
data/pkgconf-1.6.3/cli/getopt_long.c:319:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				fprintf(stderr, recargstring,
data/pkgconf-1.6.3/cli/getopt_long.c:343:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
			fprintf(stderr, illoptstring,
data/pkgconf-1.6.3/cli/getopt_long.c:534:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
			fprintf(stderr, posixly_correct ? illoptchar : gnuoptchar,
data/pkgconf-1.6.3/cli/getopt_long.c:541:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
			fprintf(stderr, illoptchar, optchar);
data/pkgconf-1.6.3/cli/getopt_long.c:556:5:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
				fprintf(stderr, recargchar, optchar);
data/pkgconf-1.6.3/cli/getopt_long.c:583:6:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
					fprintf(stderr, recargchar, optchar);
data/pkgconf-1.6.3/libpkgconf/audit.c:69:2:  [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(client->auditf, format, va);
data/pkgconf-1.6.3/libpkgconf/client.c:323: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(errbuf, sizeof errbuf, format, va);
data/pkgconf-1.6.3/libpkgconf/client.c:348: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(errbuf, sizeof errbuf, format, va);
data/pkgconf-1.6.3/libpkgconf/client.c:382: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(errbuf + len, sizeof(errbuf) - len, format, va);
data/pkgconf-1.6.3/libpkgconf/personality.c:185:2:  [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, va);
data/pkgconf-1.6.3/libpkgconf/pkg.c:330: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(buf, sizeof buf, fmt, va);
data/pkgconf-1.6.3/libpkgconf/pkg.c:529: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(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, path, name);
data/pkgconf-1.6.3/libpkgconf/pkg.c:530: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(uninst_locbuf, sizeof uninst_locbuf, "%s/%s-uninstalled" PKG_CONFIG_EXT, path, name);
data/pkgconf-1.6.3/cli/getopt_long.c:385: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") != NULL);
data/pkgconf-1.6.3/cli/main.c:886:6:  [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.
	if (getenv("PKG_CONFIG_EARLY_TRACE"))
data/pkgconf-1.6.3/cli/main.c:975:28:  [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.
	if ((env_traverse_depth = getenv("PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH")) != NULL)
data/pkgconf-1.6.3/cli/main.c:981:66:  [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.
	if ((want_flags & PKG_SILENCE_ERRORS) == PKG_SILENCE_ERRORS && !getenv("PKG_CONFIG_DEBUG_SPEW"))
data/pkgconf-1.6.3/cli/main.c:986:6:  [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.
	if (getenv("PKG_CONFIG_DONT_RELOCATE_PATHS"))
data/pkgconf-1.6.3/cli/main.c:1037:69:  [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.
	if ((want_flags & PKG_IGNORE_CONFLICTS) == PKG_IGNORE_CONFLICTS || getenv("PKG_CONFIG_IGNORE_CONFLICTS") != NULL)
data/pkgconf-1.6.3/cli/main.c:1047:45:  [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.
	if ((want_flags & PKG_PURE) == PKG_PURE || getenv("PKG_CONFIG_PURE_DEPGRAPH") != NULL)
data/pkgconf-1.6.3/cli/main.c:1063:65:  [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.
	if ((want_flags & PKG_NO_UNINSTALLED) == PKG_NO_UNINSTALLED || getenv("PKG_CONFIG_DISABLE_UNINSTALLED") != NULL)
data/pkgconf-1.6.3/cli/main.c:1098:6:  [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.
	if (getenv("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS") != NULL)
data/pkgconf-1.6.3/cli/main.c:1101:6:  [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.
	if (getenv("PKG_CONFIG_ALLOW_SYSTEM_LIBS") != NULL)
data/pkgconf-1.6.3/cli/main.c:1104:18:  [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.
	if ((builddir = getenv("PKG_CONFIG_TOP_BUILD_DIR")) != NULL)
data/pkgconf-1.6.3/cli/main.c:1107: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.
	if ((sysroot_dir = getenv("PKG_CONFIG_SYSROOT_DIR")) != NULL)
data/pkgconf-1.6.3/cli/main.c:1137:17:  [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.
		logfile_arg = getenv("PKG_CONFIG_LOG");
data/pkgconf-1.6.3/libpkgconf/client.c:70:7:  [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.
		if (getenv("PKG_CONFIG_LIBDIR") != NULL)
data/pkgconf-1.6.3/libpkgconf/client.c:114:5:  [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.
	if(getenv("PKG_CONFIG_SYSTEM_LIBRARY_PATH") == NULL)
data/pkgconf-1.6.3/libpkgconf/client.c:119:5:  [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.
	if(getenv("PKG_CONFIG_SYSTEM_INCLUDE_PATH") == NULL)
data/pkgconf-1.6.3/libpkgconf/libpkgconf.h:45: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.
#define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
data/pkgconf-1.6.3/libpkgconf/path.c:95:21:  [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 *linkdest = realpath(path, NULL);
data/pkgconf-1.6.3/libpkgconf/path.c:180: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.
	data = getenv(envvarname);
data/pkgconf-1.6.3/cli/getopt_long.c:177: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 **) nargv)[pos] = nargv[cstart];
data/pkgconf-1.6.3/cli/getopt_long.c:179: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 **)nargv)[cstart] = swap;
data/pkgconf-1.6.3/cli/main.c:414: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 workbuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/cli/main.c:710: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[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/cli/main.c:913:29:  [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).
			maximum_traverse_depth = atoi(pkg_optarg);
data/pkgconf-1.6.3/cli/main.c:976:28:  [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).
		maximum_traverse_depth = atoi(env_traverse_depth);
data/pkgconf-1.6.3/cli/main.c:1035:18:  [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).
		error_msgout = fopen(PATH_DEV_NULL, "w");
data/pkgconf-1.6.3/cli/main.c:1141: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).
		logfile_out = fopen(logfile_arg, "w");
data/pkgconf-1.6.3/cli/main.c:1265: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 packagebuf[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/libpkgconf/client.c:319: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 errbuf[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/libpkgconf/client.c:344: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 errbuf[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/libpkgconf/client.c:372: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 errbuf[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/libpkgconf/dependency.c:78: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 depbuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/dependency.c:84: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 depbuf2[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/dependency.c:232: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 cmpname[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/dependency.c:233: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[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/libpkgconf/fragment.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 mungebuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/fragment.c:151: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 mungebuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/parser.c:36: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 readbuf[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/libpkgconf/path.c:81: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 path[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/path.c:207: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 relocated[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/personality.c:33: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 namebuf[MAX_PATH];
data/pkgconf-1.6.3/libpkgconf/personality.c:34: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 outbuf[MAX_PATH];
data/pkgconf-1.6.3/libpkgconf/personality.c:192: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 pathbuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/personality.c:202:6:  [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(pathbuf, "r");
data/pkgconf-1.6.3/libpkgconf/pkg.c:55: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[PKGCONF_ITEM_SIZE], *pathbuf;
data/pkgconf-1.6.3/libpkgconf/pkg.c:267: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 canonicalized_value[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:282: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 newvalue[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:292: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 pathbuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:326: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[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:524: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 locbuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:525: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 uninst_locbuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:532:65:  [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).
	if (!(client->flags & PKGCONF_PKG_PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL)
data/pkgconf-1.6.3/libpkgconf/pkg.c:538: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).
	else if ((f = fopen(locbuf, "r")) != NULL)
data/pkgconf-1.6.3/libpkgconf/pkg.c:562: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 filebuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:575:7:  [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(filebuf, "r");
data/pkgconf-1.6.3/libpkgconf/pkg.c:640: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[16384]; /* per registry limits */
data/pkgconf-1.6.3/libpkgconf/pkg.c:649: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 pathbuf[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/pkg.c:693: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).
		if ((f = fopen(name, "r")) != NULL)
data/pkgconf-1.6.3/libpkgconf/pkg.c:763: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 buf1[PKGCONF_ITEM_SIZE], buf2[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/tuple.c:253: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[PKGCONF_BUFSIZE];
data/pkgconf-1.6.3/libpkgconf/tuple.c:266: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 varname[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/tuple.c:331: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 cleanpath[PKGCONF_ITEM_SIZE];
data/pkgconf-1.6.3/libpkgconf/win-dirent.h:228:5:  [2] (buffer) wchar_t:
  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.
    wchar_t d_name[PATH_MAX];
data/pkgconf-1.6.3/libpkgconf/win-dirent.h:280: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 d_name[PATH_MAX];
data/pkgconf-1.6.3/libpkgconf/win-dirent.h:628:9:  [2] (buffer) wchar_t:
  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.
        wchar_t wname[PATH_MAX];
data/pkgconf-1.6.3/cli/getopt_long.c:228: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).
		current_argv_len = strlen(current_argv);
data/pkgconf-1.6.3/cli/getopt_long.c:236: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(long_options[i].name) == current_argv_len) {
data/pkgconf-1.6.3/cli/renderer-msvc.c:58: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(frag->data);
data/pkgconf-1.6.3/libpkgconf/argvsplit.c:62: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).
	char *buf = malloc(strlen(src) + 1);
data/pkgconf-1.6.3/libpkgconf/argvsplit.c:73: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).
	memset(buf, 0, strlen(src) + 1);
data/pkgconf-1.6.3/libpkgconf/argvsplit.c:145: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((*argv)[argc_count]))
data/pkgconf-1.6.3/libpkgconf/bsdstubs.c:83: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).
		return(dlen + strlen(s));
data/pkgconf-1.6.3/libpkgconf/dependency.c:158:59:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		return pkgconf_dependency_addraw(client, list, package, strlen(package), version, strlen(version), compare, flags);
data/pkgconf-1.6.3/libpkgconf/dependency.c:158:85:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		return pkgconf_dependency_addraw(client, list, package, strlen(package), version, strlen(version), compare, flags);
data/pkgconf-1.6.3/libpkgconf/dependency.c:160:58:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	return pkgconf_dependency_addraw(client, list, package, strlen(package), NULL, 0, compare, flags);
data/pkgconf-1.6.3/libpkgconf/fileio.c:30:25:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (s < end && (c = getc(stream)) != EOF)
data/pkgconf-1.6.3/libpkgconf/fileio.c:42:10:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					c = getc(stream);
data/pkgconf-1.6.3/libpkgconf/fileio.c:56:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					c2 = getc(stream);
data/pkgconf-1.6.3/libpkgconf/fileio.c:75:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if ((c2 = getc(stream)) == '\n')
data/pkgconf-1.6.3/libpkgconf/fragment.c:77:58:  [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 (sysroot_dir != NULL && strncmp(sysroot_dir, string, strlen(sysroot_dir)))
data/pkgconf-1.6.3/libpkgconf/fragment.c:165: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(parent->data) + strlen(mungebuf) + 2;
data/pkgconf-1.6.3/libpkgconf/fragment.c:165:34:  [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(parent->data) + strlen(mungebuf) + 2;
data/pkgconf-1.6.3/libpkgconf/fragment.c:419: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).
	ssize_t outlen = strlen(src) + 10;
data/pkgconf-1.6.3/libpkgconf/fragment.c:465: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(quoted);
data/pkgconf-1.6.3/libpkgconf/fragment.c:505: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(quoted) > buf_remaining)
data/pkgconf-1.6.3/libpkgconf/parser.c:76: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).
		p = value + (strlen(value) - 1);
data/pkgconf-1.6.3/libpkgconf/path.c:349: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 tmpbuflen = strlen(tmpbuf);
data/pkgconf-1.6.3/libpkgconf/pkg.c:43: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).
	size_t str_len = strlen(str);
data/pkgconf-1.6.3/libpkgconf/pkg.c:44: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).
	size_t suf_len = strlen(suffix);
data/pkgconf-1.6.3/libpkgconf/pkg.c:231: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).
				memmove (p, q, strlen (q) + 1);
data/pkgconf-1.6.3/libpkgconf/pkg.c:280:76:  [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).
	    && is_path_prefix_equal(canonicalized_value, pkg->orig_prefix->value, strlen(pkg->orig_prefix->value)))
data/pkgconf-1.6.3/libpkgconf/pkg.c:285: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).
		pkgconf_strlcat(newvalue, canonicalized_value + strlen(pkg->orig_prefix->value), sizeof newvalue);
data/pkgconf-1.6.3/libpkgconf/pkg.c:853: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).
			onelen = strlen(one);
data/pkgconf-1.6.3/libpkgconf/pkg.c:854: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).
			twolen = strlen(two);
data/pkgconf-1.6.3/libpkgconf/tuple.c:142: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).
	char *buf = calloc((strlen(value) + 1) * 2, 1);
data/pkgconf-1.6.3/libpkgconf/tuple.c:257:90:  [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 (*value == '/' && client->sysroot_dir != NULL && strncmp(value, client->sysroot_dir, strlen(client->sysroot_dir)))
data/pkgconf-1.6.3/libpkgconf/tuple.c:288:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy(bptr, kv, PKGCONF_BUFSIZE - (bptr - buf));
data/pkgconf-1.6.3/libpkgconf/tuple.c:289: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).
				bptr += strlen(kv);
data/pkgconf-1.6.3/libpkgconf/tuple.c:299:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
					strncpy(bptr, parsekv, PKGCONF_BUFSIZE - (bptr - buf));
data/pkgconf-1.6.3/libpkgconf/tuple.c:300: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).
					bptr += strlen(parsekv);
data/pkgconf-1.6.3/libpkgconf/tuple.c:328: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).
	    strlen(buf) > strlen(client->sysroot_dir) &&
data/pkgconf-1.6.3/libpkgconf/tuple.c:328: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).
	    strlen(buf) > strlen(client->sysroot_dir) &&
data/pkgconf-1.6.3/libpkgconf/tuple.c:329: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).
	    strstr(buf + strlen(client->sysroot_dir), client->sysroot_dir) != NULL)
data/pkgconf-1.6.3/libpkgconf/tuple.c:333: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).
		pkgconf_strlcpy(cleanpath, buf + strlen(client->sysroot_dir), sizeof cleanpath);
data/pkgconf-1.6.3/libpkgconf/win-dirent.h:350:17:  [1] (buffer) wcslen:
  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).
            n = wcslen(dirname);

ANALYSIS SUMMARY:

Hits = 121
Lines analyzed = 9202 in approximately 0.31 seconds (29931 lines/second)
Physical Source Lines of Code (SLOC) = 5736
Hits@level = [0] 155 [1]  40 [2]  46 [3]  19 [4]  16 [5]   0
Hits@level+ = [0+] 276 [1+] 121 [2+]  81 [3+]  35 [4+]  16 [5+]   0
Hits/KSLOC@level+ = [0+] 48.1172 [1+] 21.0948 [2+] 14.1213 [3+] 6.10181 [4+] 2.7894 [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.