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/mate-user-share-1.24.0/src/caja-share-bar.c
Examining data/mate-user-share-1.24.0/src/caja-share-bar.h
Examining data/mate-user-share-1.24.0/src/file-share-properties.c
Examining data/mate-user-share-1.24.0/src/http.c
Examining data/mate-user-share-1.24.0/src/http.h
Examining data/mate-user-share-1.24.0/src/obexftp.c
Examining data/mate-user-share-1.24.0/src/obexftp.h
Examining data/mate-user-share-1.24.0/src/obexpush.c
Examining data/mate-user-share-1.24.0/src/obexpush.h
Examining data/mate-user-share-1.24.0/src/share-extension.c
Examining data/mate-user-share-1.24.0/src/user_share-common.c
Examining data/mate-user-share-1.24.0/src/user_share-common.h
Examining data/mate-user-share-1.24.0/src/user_share-private.c
Examining data/mate-user-share-1.24.0/src/user_share-private.h
Examining data/mate-user-share-1.24.0/src/user_share.c

FINAL RESULTS:

data/mate-user-share-1.24.0/src/http.c:326:49:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
	free4 = env[i++] = g_strdup_printf ("HOME=%s", g_get_home_dir());
data/mate-user-share-1.24.0/src/http.c:341:22:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
	res = g_spawn_sync (g_get_home_dir(),
data/mate-user-share-1.24.0/src/share-extension.c:150:30:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
	home = g_file_new_for_path (g_get_home_dir ());
data/mate-user-share-1.24.0/src/user_share-common.c:38:50:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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 (special_dir != NULL && strcmp (special_dir, g_get_home_dir ()) != 0) {
data/mate-user-share-1.24.0/src/user_share-common.c:44:26:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
	dir = g_build_filename (g_get_home_dir (), name, NULL);
data/mate-user-share-1.24.0/src/user_share.c:238:37:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
	old_config_dir = g_build_filename (g_get_home_dir (), ".mate2", "user-share", NULL);
data/mate-user-share-1.24.0/src/file-share-properties.c:68: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).
    file = fopen (filename, "w");
data/mate-user-share-1.24.0/src/http.c:279: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 *argv[10];
data/mate-user-share-1.24.0/src/http.c:280: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 *env[10];
data/mate-user-share-1.24.0/src/http.c:379:15:  [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).
			*pid_out = atoi (pidfile);
data/mate-user-share-1.24.0/src/share-extension.c:87: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.
        char *argv [2];
data/mate-user-share-1.24.0/src/file-share-properties.c:61: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).
    ascii_digest = g_compute_checksum_for_string (G_CHECKSUM_MD5, to_hash, strlen (to_hash));
data/mate-user-share-1.24.0/src/file-share-properties.c:70: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).
	fwrite (line, strlen (line), 1, file);
data/mate-user-share-1.24.0/src/http.c:140: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 (name) < AVAHI_LABEL_MAX)

ANALYSIS SUMMARY:

Hits = 14
Lines analyzed = 3169 in approximately 0.11 seconds (28572 lines/second)
Physical Source Lines of Code (SLOC) = 2261
Hits@level = [0]   4 [1]   3 [2]   5 [3]   6 [4]   0 [5]   0
Hits@level+ = [0+]  18 [1+]  14 [2+]  11 [3+]   6 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 7.96108 [1+] 6.19195 [2+] 4.8651 [3+] 2.65369 [4+]   0 [5+]   0
Dot directories skipped = 3 (--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.