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/rifiuti2-0.7.0/src/rifiuti-vista.c
Examining data/rifiuti2-0.7.0/src/rifiuti-vista.h
Examining data/rifiuti2-0.7.0/src/rifiuti.c
Examining data/rifiuti2-0.7.0/src/rifiuti.h
Examining data/rifiuti2-0.7.0/src/utils-win.c
Examining data/rifiuti2-0.7.0/src/utils-win.h
Examining data/rifiuti2-0.7.0/src/utils.c
Examining data/rifiuti2-0.7.0/src/utils.h
Examining data/rifiuti2-0.7.0/test/test_glib_iconv.c

FINAL RESULTS:

data/rifiuti2-0.7.0/src/utils-win.c:150:13:  [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 (((ev = getenv ("LC_ALL"))      != NULL && ev[0] != '\0') ||
data/rifiuti2-0.7.0/src/utils-win.c:151:13:  [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.
	    ((ev = getenv ("LC_MESSAGES")) != NULL && ev[0] != '\0') ||
data/rifiuti2-0.7.0/src/utils-win.c:152:13:  [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.
	    ((ev = getenv ("LANG"))        != NULL && ev[0] != '\0'))
data/rifiuti2-0.7.0/src/rifiuti-vista.c:173: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 (&record->filesize, buf + FILESIZE_OFFSET,
data/rifiuti2-0.7.0/src/rifiuti-vista.c:189: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 (&win_filetime, buf + FILETIME_OFFSET - (int) erraneous,
data/rifiuti2-0.7.0/src/rifiuti.c:53: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.
unsigned char   driveletters[28] =
data/rifiuti2-0.7.0/src/utils-win.c:145: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 iso639[10];
data/rifiuti2-0.7.0/src/utils-win.c:146: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 iso3166[10];
data/rifiuti2-0.7.0/src/utils-win.c:235: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           username[UNLEN + 1], *errmsg;
data/rifiuti2-0.7.0/src/utils.c:663: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[128];
data/rifiuti2-0.7.0/src/utils.c:680: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 buf[10];
data/rifiuti2-0.7.0/src/utils.h:163:39:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define copy_field(field, off1, off2) memcpy((field), \
data/rifiuti2-0.7.0/src/rifiuti-vista.c:161:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	size_t        read;
data/rifiuti2-0.7.0/src/rifiuti-vista.c:201:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				NULL, "<\\u%04X>", &read, &exit_status);
data/rifiuti2-0.7.0/src/rifiuti-vista.c:207:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				NULL, "<\\u%04X>", &read, &exit_status);
data/rifiuti2-0.7.0/src/rifiuti.c:196:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	size_t          read;
data/rifiuti2-0.7.0/src/rifiuti.c:249:48:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			legacy_fname, legacy_encoding, "<\\%02X>", &read, &exit_status);
data/rifiuti2-0.7.0/src/rifiuti.c:269:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		"<\\u%04X>", &read, &exit_status);
data/rifiuti2-0.7.0/src/rifiuti.c:296:46:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		for (ptr = buf + UNICODE_FILENAME_OFFSET + read;
data/rifiuti2-0.7.0/src/utils-win.c:416:38:  [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).
	if (WriteConsoleW (wincon_fh, wstr, wcslen (wstr), NULL, NULL))
data/rifiuti2-0.7.0/src/utils.c:469: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).
		*write_bytes -= strlen (repl);
data/rifiuti2-0.7.0/src/utils.c:485: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).
	s = g_string_sized_new (strlen (str) * 2);
data/rifiuti2-0.7.0/src/utils.c:526:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                             size_t     *read,
data/rifiuti2-0.7.0/src/utils.c:542: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).
		out_ch_width = MAX (strlen(s), 6);
data/rifiuti2-0.7.0/src/utils.c:610:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read != NULL)
data/rifiuti2-0.7.0/src/utils.h:224:61:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                                           size_t          *read,

ANALYSIS SUMMARY:

Hits = 26
Lines analyzed = 3202 in approximately 0.09 seconds (36005 lines/second)
Physical Source Lines of Code (SLOC) = 2099
Hits@level = [0]   5 [1]  14 [2]   9 [3]   3 [4]   0 [5]   0
Hits@level+ = [0+]  31 [1+]  26 [2+]  12 [3+]   3 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 14.7689 [1+] 12.3869 [2+] 5.71701 [3+] 1.42925 [4+]   0 [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.