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-desktop-1.24.1/config.meson.h
Examining data/mate-desktop-1.24.1/libmate-desktop/display-name.c
Examining data/mate-desktop-1.24.1/libmate-desktop/edid-parse.c
Examining data/mate-desktop-1.24.1/libmate-desktop/edid.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-bg-crossfade.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-bg-crossfade.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-bg.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-bg.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-colorbutton.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-colorbutton.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-colorsel.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-colorsel.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-colorseldialog.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-colorseldialog.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-dconf.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-dconf.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-thumbnail.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-thumbnail.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-utils.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-desktop.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-gsettings.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-gsettings.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-hsv.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-hsv.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-languages.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr-config.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr-config.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr-labeler.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr-labeler.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr-output-info.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr-private.h
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-rr.h
Examining data/mate-desktop-1.24.1/libmate-desktop/private.h
Examining data/mate-desktop-1.24.1/libmate-desktop/test-desktop-thumbnail.c
Examining data/mate-desktop-1.24.1/libmate-desktop/test-ditem.c
Examining data/mate-desktop-1.24.1/libmate-desktop/test-languages.c
Examining data/mate-desktop-1.24.1/libmate-desktop/test.c
Examining data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-utils.c
Examining data/mate-desktop-1.24.1/mate-about/mate-about.c
Examining data/mate-desktop-1.24.1/tools/mate-color-select.c

FINAL RESULTS:

data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:2315: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 (exec, X_OK) == 0)
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:1804:17:  [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.
		working_dir = g_get_home_dir ();
data/mate-desktop-1.24.1/mate-about/mate-about.c:69:77:  [3] (random) g_random_int_range:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    gtk_about_dialog_set_comments(mate_about_dialog, gettext(comments_array[g_random_int_range(0, comments_count - 1)]));
data/mate-desktop-1.24.1/libmate-desktop/display-name.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.
	const char vendor_id[4];
data/mate-desktop-1.24.1/libmate-desktop/display-name.c:38: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.
	const char vendor_name[28];
data/mate-desktop-1.24.1/libmate-desktop/edid.h:102: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 manufacturer_code[4];
data/mate-desktop-1.24.1/libmate-desktop/edid.h:176: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 dsc_serial_number[14];
data/mate-desktop-1.24.1/libmate-desktop/edid.h:177: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 dsc_product_name[14];
data/mate-desktop-1.24.1/libmate-desktop/edid.h:178: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 dsc_string[14]; /* Unspecified ASCII data */
data/mate-desktop-1.24.1/libmate-desktop/mate-bg.c:2648: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 (d, gradient, copy_bytes_per_row);
data/mate-desktop-1.24.1/libmate-desktop/mate-bg.c:2765:19:  [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).
				size->width = atoi (attr_values[i]);
data/mate-desktop-1.24.1/libmate-desktop/mate-bg.c:2767:20:  [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).
				size->height = atoi (attr_values[i]);
data/mate-desktop-1.24.1/libmate-desktop/mate-colorbutton.c:236:19:  [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 unsigned char data[8] = { 0xFF, 0x00, 0x00, 0x00,
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:474: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[BUFSIZ];
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:2929:3:  [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 (value) != 0);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3056:7:  [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 (value) != 0) {
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3226: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 lang[3];
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3257: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 [BUFSIZ];
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3603: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 CharBuffer [1024];
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-utils.c:167:33:  [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.
                real_argv[i] = (char *)the_argv[j];
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:697: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 first[8] = { 0 };
data/mate-desktop-1.24.1/libmate-desktop/mate-rr.c:2099:5:  [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 (gamma->red, red, copy_size);
data/mate-desktop-1.24.1/libmate-desktop/mate-rr.c:2100:5:  [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 (gamma->green, green, copy_size);
data/mate-desktop-1.24.1/libmate-desktop/mate-rr.c:2101:5:  [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 (gamma->blue, blue, copy_size);
data/mate-desktop-1.24.1/libmate-desktop/mate-rr.c:2138: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 (r, gamma->red, copy_size);
data/mate-desktop-1.24.1/libmate-desktop/mate-rr.c:2144: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 (g, gamma->green, copy_size);
data/mate-desktop-1.24.1/libmate-desktop/mate-rr.c:2150: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 (b, gamma->blue, copy_size);
data/mate-desktop-1.24.1/libmate-desktop/test-ditem.c:35: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[256];
data/mate-desktop-1.24.1/libmate-desktop/mate-bg.c:646: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).
						    strlen (filename));
data/mate-desktop-1.24.1/libmate-desktop/mate-colorsel.c:1078: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).
      gint n_dashes = strlen ((gchar *)dash_list);
data/mate-desktop-1.24.1/libmate-desktop/mate-dconf.c:124: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).
                val[strlen (val) - 1] = '\0';
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:713: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).
		length = strlen (string);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:1518: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).
	desktop_startup_id_len = strlen ("DESKTOP_STARTUP_ID");
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:1724:43:  [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 (envp [env_len], "DISPLAY", strlen ("DISPLAY")) == 0)
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:2056: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).
	exec_len = strlen (exec);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:2132: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).
	the_exec = g_alloca (strlen (exec) + 1);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:2133:29:  [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).
	g_strlcpy (the_exec, exec, strlen (exec) + 1);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3062: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 (value);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3077: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 *p = g_malloc (strlen (s) + 1);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3248:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy (lang, locale, 2);
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3263:9:  [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 (MATE_DESKTOP_ITEM_ENCODING)) == 0) {
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3264: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 *p = &buf[strlen (MATE_DESKTOP_ITEM_ENCODING)];
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-item.c:3806:57:  [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).
    g_output_stream_write (G_OUTPUT_STREAM (stream), s, strlen (s),
data/mate-desktop-1.24.1/libmate-desktop/mate-desktop-thumbnail.c:669:54:  [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).
  g_checksum_update (checksum, (const guchar *) uri, strlen (uri));
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:461: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).
                if (strlen (old_locale->name) > strlen (locale->name)) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:461:49:  [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 (old_locale->name) > strlen (locale->name)) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:666: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).
        len = strlen (code);
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:751: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).
        len = strlen (code);
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:822:37:  [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 (*attr_values) != 2) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:830:37:  [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 (*attr_values) != 3) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:838:37:  [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 (*attr_values) != 3) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:846:37:  [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 (*attr_values) != 2 &&
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:847:37:  [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 (*attr_values) != 3) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:914:37:  [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 (*attr_values) != 2) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:922:37:  [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 (*attr_values) != 3) {
data/mate-desktop-1.24.1/libmate-desktop/mate-languages.c:930:37:  [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 (*attr_values) != 3) {
data/mate-desktop-1.24.1/libmate-desktop/mate-rr-config.c:275:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy ((gchar*) parser->output->priv->vendor, text, 3);
data/mate-desktop-1.24.1/libmate-desktop/test-ditem.c:93: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).
	getcwd (path, 255 - strlen ("/foo.desktop"));

ANALYSIS SUMMARY:

Hits = 58
Lines analyzed = 25322 in approximately 0.55 seconds (45970 lines/second)
Physical Source Lines of Code (SLOC) = 17731
Hits@level = [0]   6 [1]  30 [2]  25 [3]   2 [4]   1 [5]   0
Hits@level+ = [0+]  64 [1+]  58 [2+]  28 [3+]   3 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 3.6095 [1+] 3.27111 [2+] 1.57916 [3+] 0.169195 [4+] 0.0563984 [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.