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/stalonetray-0.8.1/src/main.c
Examining data/stalonetray-0.8.1/src/xutils.c
Examining data/stalonetray-0.8.1/src/layout.h
Examining data/stalonetray-0.8.1/src/settings.c
Examining data/stalonetray-0.8.1/src/embed.c
Examining data/stalonetray-0.8.1/src/image.c
Examining data/stalonetray-0.8.1/src/settings.h
Examining data/stalonetray-0.8.1/src/list.h
Examining data/stalonetray-0.8.1/src/tray.h
Examining data/stalonetray-0.8.1/src/xutils.h
Examining data/stalonetray-0.8.1/src/xembed.h
Examining data/stalonetray-0.8.1/src/kde_tray.c
Examining data/stalonetray-0.8.1/src/debug.h
Examining data/stalonetray-0.8.1/src/wmh.c
Examining data/stalonetray-0.8.1/src/wmh.h
Examining data/stalonetray-0.8.1/src/icons.h
Examining data/stalonetray-0.8.1/src/image.h
Examining data/stalonetray-0.8.1/src/scrollbars.h
Examining data/stalonetray-0.8.1/src/common.h
Examining data/stalonetray-0.8.1/src/icons.c
Examining data/stalonetray-0.8.1/src/xembed.c
Examining data/stalonetray-0.8.1/src/tray.c
Examining data/stalonetray-0.8.1/src/embed.h
Examining data/stalonetray-0.8.1/src/layout.c
Examining data/stalonetray-0.8.1/src/scrollbars.c
Examining data/stalonetray-0.8.1/src/kde_tray.h
Examining data/stalonetray-0.8.1/src/debug.c

FINAL RESULTS:

data/stalonetray-0.8.1/src/debug.c:37:2:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	vsnprintf(msg, PATH_MAX, fmt, va);
data/stalonetray-0.8.1/src/xutils.c:426: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(cmd);
data/stalonetray-0.8.1/src/xutils.c:428: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(cmd);
data/stalonetray-0.8.1/src/settings.c:707:19:  [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 ((home_dir = getenv("HOME")) == NULL) {
data/stalonetray-0.8.1/src/debug.c:34: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 msg[PATH_MAX];
data/stalonetray-0.8.1/src/debug.c:51:16:  [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 timestr[PATH_MAX+1];
data/stalonetray-0.8.1/src/icons.c:101: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(tmp, cur, sizeof(struct TrayIcon));
data/stalonetray-0.8.1/src/icons.c:120: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(cur_i, cur_b, sizeof(struct TrayIcon));
data/stalonetray-0.8.1/src/settings.c:354:17:  [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 = (char **) tgt[1];
data/stalonetray-0.8.1/src/settings.c:401:32:  [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.
typedef int (*param_parser_t) (char *str, void *tgt[MAX_TARGETS], int silent);
data/stalonetray-0.8.1/src/settings.c:694: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 config_fname[PATH_MAX];
data/stalonetray-0.8.1/src/settings.c:697: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[READ_BUF_SZ + 1];
data/stalonetray-0.8.1/src/settings.c:718:8:  [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).
	cfg = fopen(settings.config_fname, "r");
data/stalonetray-0.8.1/src/xembed.c:440: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[20];
data/stalonetray-0.8.1/src/xutils.c:44: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 msg[PATH_MAX], req_num_str[32], req_str[PATH_MAX];
data/stalonetray-0.8.1/src/xutils.c:382: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.
const char *x11_event_names[LASTEvent] = {
data/stalonetray-0.8.1/src/xutils.c:424: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 cmd[PATH_MAX];
data/stalonetray-0.8.1/src/xutils.h:103:14:  [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 extern char *x11_event_names[LASTEvent];
data/stalonetray-0.8.1/src/settings.c:145: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).
	s = strlen(str);
data/stalonetray-0.8.1/src/settings.c:359: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 (str == NULL || strlen(str) == 0) return FAILURE;
data/stalonetray-0.8.1/src/settings.c:560: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).
					if ((*argv)[strlen(p->short_name)] != '\0') /* accept arguments in the form -a5 */
data/stalonetray-0.8.1/src/settings.c:561: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).
						arg = *argv + strlen(p->short_name);
data/stalonetray-0.8.1/src/settings.c:572: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).
					if ((*argv)[strlen(p->long_name)] == '=') /* accept arguments in the form --abcd=5 */
data/stalonetray-0.8.1/src/settings.c:573: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).
						arg = *argv + strlen(p->long_name) + 1;
data/stalonetray-0.8.1/src/settings.c:574: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).
					else if ((*argv)[strlen(p->long_name)] == '\0') { /* accept arguments in the from ---abcd 5 */
data/stalonetray-0.8.1/src/tray.c:639:39:  [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).
		tray_sel_atom_name = (char *)malloc(strlen(TRAY_SEL_ATOM) + 10);
data/stalonetray-0.8.1/src/tray.c:642:5:  [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(TRAY_SEL_ATOM) + 10,

ANALYSIS SUMMARY:

Hits = 27
Lines analyzed = 6795 in approximately 0.22 seconds (30953 lines/second)
Physical Source Lines of Code (SLOC) = 5188
Hits@level = [0]  15 [1]   9 [2]  14 [3]   1 [4]   3 [5]   0
Hits@level+ = [0+]  42 [1+]  27 [2+]  18 [3+]   4 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 8.09561 [1+] 5.20432 [2+] 3.46955 [3+] 0.77101 [4+] 0.578258 [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.