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/gnome-terminal-3.38.1/src/terminal-settings-list.c
Examining data/gnome-terminal-3.38.1/src/server.c
Examining data/gnome-terminal-3.38.1/src/profile-editor.c
Examining data/gnome-terminal-3.38.1/src/terminal-app.h
Examining data/gnome-terminal-3.38.1/src/terminal-search-provider.h
Examining data/gnome-terminal-3.38.1/src/terminal-profiles-list.c
Examining data/gnome-terminal-3.38.1/src/terminal-client-utils.h
Examining data/gnome-terminal-3.38.1/src/terminal-profiles-list.h
Examining data/gnome-terminal-3.38.1/src/terminal-i18n.c
Examining data/gnome-terminal-3.38.1/src/terminal-enums.h
Examining data/gnome-terminal-3.38.1/src/terminal.c
Examining data/gnome-terminal-3.38.1/src/terminal-headerbar.c
Examining data/gnome-terminal-3.38.1/src/terminal-tab-label.h
Examining data/gnome-terminal-3.38.1/src/terminal-window.c
Examining data/gnome-terminal-3.38.1/src/terminal-defines.h
Examining data/gnome-terminal-3.38.1/src/terminal-notebook.h
Examining data/gnome-terminal-3.38.1/src/terminal-menu-button.h
Examining data/gnome-terminal-3.38.1/src/terminal-version.h
Examining data/gnome-terminal-3.38.1/src/eggshell.h
Examining data/gnome-terminal-3.38.1/src/terminal-tab-label.c
Examining data/gnome-terminal-3.38.1/src/terminal-options.h
Examining data/gnome-terminal-3.38.1/src/terminal-window.h
Examining data/gnome-terminal-3.38.1/src/terminal-app.c
Examining data/gnome-terminal-3.38.1/src/terminal-debug.c
Examining data/gnome-terminal-3.38.1/src/terminal-libgsystem.h
Examining data/gnome-terminal-3.38.1/src/terminal-intl.h
Examining data/gnome-terminal-3.38.1/src/terminal-debug.h
Examining data/gnome-terminal-3.38.1/src/terminal-screen-container.c
Examining data/gnome-terminal-3.38.1/src/terminal-notebook.c
Examining data/gnome-terminal-3.38.1/src/profile-editor.h
Examining data/gnome-terminal-3.38.1/src/terminal-search-popover.c
Examining data/gnome-terminal-3.38.1/src/terminal-menu-button.c
Examining data/gnome-terminal-3.38.1/src/terminal-accels.c
Examining data/gnome-terminal-3.38.1/src/terminal-icon-button.h
Examining data/gnome-terminal-3.38.1/src/terminal-accels.h
Examining data/gnome-terminal-3.38.1/src/terminal-nautilus.c
Examining data/gnome-terminal-3.38.1/src/terminal-util.c
Examining data/gnome-terminal-3.38.1/src/terminal-settings-list.h
Examining data/gnome-terminal-3.38.1/src/terminal-gdbus.c
Examining data/gnome-terminal-3.38.1/src/terminal-icon-button.c
Examining data/gnome-terminal-3.38.1/src/terminal-prefs.h
Examining data/gnome-terminal-3.38.1/src/terminal-i18n.h
Examining data/gnome-terminal-3.38.1/src/terminal-headerbar.h
Examining data/gnome-terminal-3.38.1/src/terminal-prefs.c
Examining data/gnome-terminal-3.38.1/src/terminal-util.h
Examining data/gnome-terminal-3.38.1/src/terminal-gdbus.h
Examining data/gnome-terminal-3.38.1/src/terminal-screen-container.h
Examining data/gnome-terminal-3.38.1/src/terminal-search-provider.c
Examining data/gnome-terminal-3.38.1/src/terminal-screen.h
Examining data/gnome-terminal-3.38.1/src/terminal-schemas.h
Examining data/gnome-terminal-3.38.1/src/terminal-pcre2.h
Examining data/gnome-terminal-3.38.1/src/eggshell.c
Examining data/gnome-terminal-3.38.1/src/terminal-regex.h
Examining data/gnome-terminal-3.38.1/src/terminal-options.c
Examining data/gnome-terminal-3.38.1/src/terminal-regex.c
Examining data/gnome-terminal-3.38.1/src/terminal-info-bar.h
Examining data/gnome-terminal-3.38.1/src/terminal-mdi-container.c
Examining data/gnome-terminal-3.38.1/src/terminal-mdi-container.h
Examining data/gnome-terminal-3.38.1/src/terminal-info-bar.c
Examining data/gnome-terminal-3.38.1/src/terminal-search-popover.h
Examining data/gnome-terminal-3.38.1/src/terminal-client-utils.c
Examining data/gnome-terminal-3.38.1/src/terminal-screen.c

FINAL RESULTS:

data/gnome-terminal-3.38.1/src/terminal-screen.c:379:13:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
      len = readlink (cwd_file, buf, sizeof (buf) - 1);
data/gnome-terminal-3.38.1/src/eggshell.c:75:8:  [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 (shell, X_OK) == 0) {
data/gnome-terminal-3.38.1/src/eggshell.c:82: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 (pw->pw_shell, X_OK) == 0) {
data/gnome-terminal-3.38.1/src/eggshell.c:88: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 (shells [i], X_OK) == 0) {
data/gnome-terminal-3.38.1/src/server.c:142: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.
  const char *home_dir = g_get_home_dir ();
data/gnome-terminal-3.38.1/src/terminal-nautilus.c:432:24:  [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.
      path = g_strdup (g_get_home_dir ());
data/gnome-terminal-3.38.1/src/terminal-screen.c:1023:11:  [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.
    cwd = g_get_home_dir ();
data/gnome-terminal-3.38.1/src/profile-editor.c:557:7:  [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 name[32];
data/gnome-terminal-3.38.1/src/profile-editor.c:1057:7:  [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 name[32];
data/gnome-terminal-3.38.1/src/terminal-nautilus.c:188:13:  [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).
    *port = atoi (tmp);  /*FIXME: getservbyname*/
data/gnome-terminal-3.38.1/src/terminal-nautilus.c:299: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 startup_id[32];
data/gnome-terminal-3.38.1/src/terminal-screen.c:370:7:  [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 cwd_file[64];
data/gnome-terminal-3.38.1/src/terminal-screen.c:371:7:  [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[PATH_MAX + 1];
data/gnome-terminal-3.38.1/src/terminal-screen.c:557: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 uuidstr[37];
data/gnome-terminal-3.38.1/src/terminal-screen.c:2092: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 *uris[2];
data/gnome-terminal-3.38.1/src/terminal-screen.c:2128: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 *uris[2];
data/gnome-terminal-3.38.1/src/terminal-screen.c:2326: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 filename[64];
data/gnome-terminal-3.38.1/src/terminal-settings-list.c:132: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 *s[2] = { (char *) str, NULL };
data/gnome-terminal-3.38.1/src/terminal-settings-list.c:197: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 name[37];
data/gnome-terminal-3.38.1/src/terminal-util.c:718: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 *default_shells[3] = {
data/gnome-terminal-3.38.1/src/terminal-util.c:1003: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(out, in, firstgrouplen);
data/gnome-terminal-3.38.1/src/terminal-util.c:1008: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(out, sep, seplen);
data/gnome-terminal-3.38.1/src/terminal-util.c:1010: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(out, in, groupby);
data/gnome-terminal-3.38.1/src/terminal-util.c:1522: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 (name + pathlen + 1, program, len);
data/gnome-terminal-3.38.1/src/terminal-util.c:1541:18:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        startp = memcpy (name - (p - path), path, p - path);
data/gnome-terminal-3.38.1/src/terminal-window.c:919: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 geometry[32];
data/gnome-terminal-3.38.1/src/terminal-window.c:2101: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 uuidstr[37], role[64];
data/gnome-terminal-3.38.1/src/terminal-app.c:433: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).
  str = g_string_sized_new (strlen (label) + 4 + 1 + 8);
data/gnome-terminal-3.38.1/src/terminal-client-utils.c:204:65:  [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).
                     8, PropModeReplace, (unsigned char *)name, strlen (name));
data/gnome-terminal-3.38.1/src/terminal-nautilus.c:160:41:  [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_assert (!strncmp (uri, SFTP_PREFIX, strlen (SFTP_PREFIX)));
data/gnome-terminal-3.38.1/src/terminal-nautilus.c:161: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).
  uri += strlen (SFTP_PREFIX);
data/gnome-terminal-3.38.1/src/terminal-screen.c:2060:63:  [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).
        vte_terminal_feed_child (VTE_TERMINAL (screen), text, strlen (text));
data/gnome-terminal-3.38.1/src/terminal-settings-list.c:869: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).
  p = path + strlen (list->path);
data/gnome-terminal-3.38.1/src/terminal-settings-list.c:872:25:  [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_return_val_if_fail (strlen (p) == 37, NULL);
data/gnome-terminal-3.38.1/src/terminal-util.c:371: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).
    len += strlen (uris[i]) + 1;
data/gnome-terminal-3.38.1/src/terminal-util.c:997: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).
  inlen = strlen(in);
data/gnome-terminal-3.38.1/src/terminal-util.c:998: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).
  seplen = strlen(sep);
data/gnome-terminal-3.38.1/src/terminal-util.c:1517: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).
  len = strlen (program) + 1;
data/gnome-terminal-3.38.1/src/terminal-util.c:1518: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).
  pathlen = strlen (path);
data/gnome-terminal-3.38.1/src/terminal.c:486: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).
            p += strlen ("/window/");

ANALYSIS SUMMARY:

Hits = 40
Lines analyzed = 22897 in approximately 0.64 seconds (35544 lines/second)
Physical Source Lines of Code (SLOC) = 16207
Hits@level = [0]   1 [1]  13 [2]  20 [3]   3 [4]   3 [5]   1
Hits@level+ = [0+]  41 [1+]  40 [2+]  27 [3+]   7 [4+]   4 [5+]   1
Hits/KSLOC@level+ = [0+] 2.52977 [1+] 2.46807 [2+] 1.66595 [3+] 0.431912 [4+] 0.246807 [5+] 0.0617017
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.