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/alltray-0.71b/src/main.c
Examining data/alltray-0.71b/src/common.h
Examining data/alltray-0.71b/src/parent.c
Examining data/alltray-0.71b/src/parent.h
Examining data/alltray-0.71b/src/child.c
Examining data/alltray-0.71b/src/child.h
Examining data/alltray-0.71b/src/utils.c
Examining data/alltray-0.71b/src/utils.h
Examining data/alltray-0.71b/src/trayicon.c
Examining data/alltray-0.71b/src/trayicon.h
Examining data/alltray-0.71b/src/balloon_message.c
Examining data/alltray-0.71b/src/balloon_message.h
Examining data/alltray-0.71b/src/xmms.c
Examining data/alltray-0.71b/src/xmms.h
Examining data/alltray-0.71b/src/clickmode.c
Examining data/alltray-0.71b/src/clickmode.h
Examining data/alltray-0.71b/src/binreloc.c
Examining data/alltray-0.71b/src/binreloc.h
Examining data/alltray-0.71b/src/grab.c
Examining data/alltray-0.71b/src/grab.h
Examining data/alltray-0.71b/src/gnome_theme.c
Examining data/alltray-0.71b/src/gnome_theme.h
Examining data/alltray-0.71b/src/kde.c
Examining data/alltray-0.71b/src/kde.h
Examining data/alltray-0.71b/src/clientwin.c
Examining data/alltray-0.71b/src/clientwin.h
Examining data/alltray-0.71b/src/shortcut.c
Examining data/alltray-0.71b/src/shortcut.h
Examining data/alltray-0.71b/src/eventfilter.c
Examining data/alltray-0.71b/src/eventfilter.h
Examining data/alltray-0.71b/src/inlinepixbufs.h
Examining data/alltray-0.71b/lib/nomap.c

FINAL RESULTS:

data/alltray-0.71b/src/binreloc.c:77:10:  [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.
		size = readlink (path2, path, buf_size - 1);
data/alltray-0.71b/lib/nomap.c:42:26:  [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.
#   define DPRINTF(args) fprintf args
data/alltray-0.71b/lib/nomap.c:87:3:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  system (tmp);
data/alltray-0.71b/src/trayicon.c:108:5:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    system ("xmms -f && xmms -p &");
data/alltray-0.71b/src/utils.c:154:3:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  system (tmp);
data/alltray-0.71b/src/utils.c:494:3:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  printf(window_id_format, window);         /* print id # in hex/dec */
data/alltray-0.71b/lib/nomap.c:119: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.
    old_preload=getenv ("OLD_PRELOAD");
data/alltray-0.71b/lib/nomap.c:128:14:  [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.
    xmms_env=getenv ("ALLTRAY_XMMS");
data/alltray-0.71b/lib/nomap.c:146: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.
  spy_id_string=getenv ("ALLTRAY_SPY_WINDOW");
data/alltray-0.71b/src/child.c:321: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.
  old_preload = getenv("LD_PRELOAD");
data/alltray-0.71b/src/gnome_theme.c:169:34:  [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.
  theme_file = g_build_filename (g_get_home_dir (), ".themes", metacity_theme, 
data/alltray-0.71b/src/kde.c:344:25:  [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.
  user_dir=g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ".alltray", NULL);
data/alltray-0.71b/lib/nomap.c:66: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 buf[64];
data/alltray-0.71b/lib/nomap.c:85: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 tmp[128];
data/alltray-0.71b/lib/nomap.c:86:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
  sprintf (tmp, "xprop -id %d &", window);
data/alltray-0.71b/lib/nomap.c:152:12:  [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).
    spy_id=atoi (spy_id_string);
data/alltray-0.71b/src/binreloc.c:121: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 ("/proc/self/maps", "r");
data/alltray-0.71b/src/binreloc.c:187: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 *address_string, line[SIZE], *found;
data/alltray-0.71b/src/binreloc.c:192: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 ("/proc/self/maps", "r");
data/alltray-0.71b/src/binreloc.c:252: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 (address_string, "0x", 2);
data/alltray-0.71b/src/binreloc.c:253: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 (address_string + 2, start_addr, len);
data/alltray-0.71b/src/binreloc.c:257: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 (address_string, "0x", 2);
data/alltray-0.71b/src/binreloc.c:258: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 (address_string + 2, end_addr, len);
data/alltray-0.71b/src/gnome_theme.c:93:36:  [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).
          win->target_right_border=atoi (attr_vals[i+1]);
data/alltray-0.71b/src/kde.c:321:8:  [2] (misc) open:
  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).
  fd = open(file, O_WRONLY | O_TRUNC | O_CREAT, mode);
data/alltray-0.71b/src/kde.c:406:10:  [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(user_dir, "r");
data/alltray-0.71b/src/parent.c:349: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).
      *title_time=atoi (argv[i+1]);
data/alltray-0.71b/src/shortcut.c:68:18:  [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).
    *key_return =atoi (++colon);
data/alltray-0.71b/src/shortcut.c:122:18:  [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).
    *key_return =atoi (tmp);
data/alltray-0.71b/src/utils.c:138: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 temp[50];
data/alltray-0.71b/src/utils.c:141:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
  sprintf(temp, "_NET_SYSTEM_TRAY_S%i", XScreenNumberOfScreen(screen));
data/alltray-0.71b/src/utils.c:275: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 (*windows, (Window*) data, sizeof (Window) * nitems);
data/alltray-0.71b/src/binreloc.c:72:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
	strncpy (path2, "/proc/self/exe", buf_size - 1);
data/alltray-0.71b/src/binreloc.c:104:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy (path, path2, buf_size - 1);
data/alltray-0.71b/src/binreloc.c:140: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).
	buf_size = strlen (line);
data/alltray-0.71b/src/binreloc.c:228: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 (file);
data/alltray-0.71b/src/binreloc.c:235: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 (file);
data/alltray-0.71b/src/binreloc.c:240: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 (start_addr);
data/alltray-0.71b/src/binreloc.c:241: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).
		if (len != strlen (end_addr))
data/alltray-0.71b/src/child.c:152: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).
      strlen (class_hints.res_name) *sizeof (gchar));
data/alltray-0.71b/src/child.c:155: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).
      strlen (win->command) *sizeof (gchar));
data/alltray-0.71b/src/child.c:161: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).
      strlen (res_name_down) * sizeof (gchar), command_down)){
data/alltray-0.71b/src/kde.c:317:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  umask(0);
data/alltray-0.71b/src/kde.c:319: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).
  size = strlen(str);
data/alltray-0.71b/src/parent.c:398:33:  [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 (!rest_buf || (rest_buf && strlen (rest_buf) == 0 && !*configure)) {
data/alltray-0.71b/src/parent.c:435: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 (new.command) == 0) {
data/alltray-0.71b/src/parent.c:445: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 (tmp) == 0) {
data/alltray-0.71b/src/parent.c:470: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).
      strlen (command_copy) , " ");

ANALYSIS SUMMARY:

Hits = 48
Lines analyzed = 8661 in approximately 0.23 seconds (38102 lines/second)
Physical Source Lines of Code (SLOC) = 5581
Hits@level = [0] 241 [1]  16 [2]  20 [3]   6 [4]   5 [5]   1
Hits@level+ = [0+] 289 [1+]  48 [2+]  32 [3+]  12 [4+]   6 [5+]   1
Hits/KSLOC@level+ = [0+] 51.7828 [1+] 8.60061 [2+] 5.73374 [3+] 2.15015 [4+] 1.07508 [5+] 0.179179
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.