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/matchbox-keyboard-0.2+git20160713/gtk-im/im-context.h
Examining data/matchbox-keyboard-0.2+git20160713/gtk-im/im-context.c
Examining data/matchbox-keyboard-0.2+git20160713/gtk-im/im-protocol.h
Examining data/matchbox-keyboard-0.2+git20160713/gtk-im/im-module.c
Examining data/matchbox-keyboard-0.2+git20160713/gtk-im/im-protocol.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-popup.c
Examining data/matchbox-keyboard-0.2+git20160713/src/util-list.h
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-key.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-layout.c
Examining data/matchbox-keyboard-0.2+git20160713/src/util.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-remote.c
Examining data/matchbox-keyboard-0.2+git20160713/src/config-parser.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-defs.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui-cairo-backend.h
Examining data/matchbox-keyboard-0.2+git20160713/src/libmatchbox-keyboard.h
Examining data/matchbox-keyboard-0.2+git20160713/src/main.c
Examining data/matchbox-keyboard-0.2+git20160713/src/util-list.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-row.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-popup.h
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.h
Examining data/matchbox-keyboard-0.2+git20160713/src/mb-gtk-keyboard.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-remote.h
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui-xft-backend.c
Examining data/matchbox-keyboard-0.2+git20160713/src/libmatchbox-keyboard.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-xembed.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-image.c
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui-xft-backend.h
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui-cairo-backend.c
Examining data/matchbox-keyboard-0.2+git20160713/src/mb-gtk-keyboard.h
Examining data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui.c
Examining data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c
Examining data/matchbox-keyboard-0.2+git20160713/applet/applet.c

FINAL RESULTS:

data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:70:13:  [4] (shell) execlp:
  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.
            execlp ("/bin/sh", "sh", "-c", "matchbox-keyboard --xid --fontfamily dejavu:sans --fontptsize 10 --fontvariant mono symbol", NULL);
data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:73:13:  [4] (shell) execlp:
  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.
            execlp ("/bin/sh", "sh", "-c", "matchbox-keyboard --xid --fontfamily dejavu:sans --fontptsize 10 --fontvariant mono", NULL);
data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:76:13:  [4] (shell) execlp:
  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.
            execlp ("/bin/sh", "sh", "-c", "matchbox-keyboard --xid --fontfamily dejavu:sans --fontptsize 10 --fontvariant mono numpad-extended", NULL);
data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:84:15:  [4] (shell) execlp:
  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.
              execlp ("/bin/sh", "sh", "-c", string->str, NULL);
data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:89:13:  [4] (shell) execlp:
  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.
            execlp ("/bin/sh", "sh", "-c", "matchbox-keyboard --xid --fontfamily dejavu:sans --fontptsize 12 --fontvariant mono:bold numpad-small", NULL);
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:260:3:  [4] (format) snprintf:
  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.
  snprintf(path, 1024, PKGDATADIR "/%s%s%s.xml",
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:270:3:  [4] (format) snprintf:
  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.
  snprintf(path, 1024, PKGDATADIR "/%s%s.xml",
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:278:3:  [4] (format) snprintf:
  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.
  snprintf(path, 1024, PKGDATADIR "/%s%s.xml",
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:286:3:  [4] (format) snprintf:
  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.
  snprintf(path, 1024, PKGDATADIR "/%s.xml", basename);
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.h:65:2:  [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.
 fprintf (stderr,  __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:202:7:  [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 (getenv("MB_KBD_CONFIG"))
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:204:34:  [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.
      snprintf(path, 1024, "%s", getenv("MB_KBD_CONFIG"));
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:218:18:  [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.
          lang = getenv("MB_KBD_LANG");
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:221:20:  [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.
            lang = getenv("LANG");
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:248:7:  [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 (getenv("HOME"))
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:250:51:  [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.
      snprintf(path, 1024, "%s/.matchbox/%s.xml", getenv("HOME"), basename);
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:391:44:  [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.
	    snprintf(buf, 512, "%s/.matchbox/%s", getenv("HOME"), &val[6]);
data/matchbox-keyboard-0.2+git20160713/src/main.c:244:31:  [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 ((mb_xdpy = XOpenDisplay(getenv("DISPLAY"))) == NULL)
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.c:301:15:  [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.
    variant = getenv("MB_KBD_VARIANT");
data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:47: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   buf[256], c;
data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:114:12:  [2] (integer) atol:
  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).
  result = atol (buf);
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:190: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           path[1024]; 	/* XXX MAXPATHLEN */
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:296:40:  [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).
  if (stat(path, &stat_info) || !(fp = fopen(path, "rb")))
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:387:4:  [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[512];
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:547:11:  [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).
      if (atoi(val) > 0)
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:548:48:  [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).
	mb_kbd_key_set_req_uwidth(state->current_key, atoi(val));
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-image.c:38:12:  [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.
  unsigned char header[8];
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-image.c:46:13:  [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).
  if ((fd = fopen( file, "rb" )) == NULL) return NULL;
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui-xft-backend.c:90: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 desc[512];
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.c:155:15:  [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 family[FONT_FAMILY_LEN];
data/matchbox-keyboard-0.2+git20160713/examples/matchbox-keyboard-gtk-embed.c:106:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      n = read(stdout_pipe[0], &c, 1);
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:226: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).
          n = strlen(lang) + 2;
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:243: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).
      n = strlen(variant_in) + 2;
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:473:8:  [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(val) > 1  	/* match backspace, return etc */
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:667:28:  [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 (! XML_Parse(p, data, strlen(data), 1)) {
data/matchbox-keyboard-0.2+git20160713/src/config-parser.c:735:28:  [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 (! XML_Parse(p, data, strlen(data), 1)) {
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui-xft-backend.c:54:8:  [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(str),
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard-ui-xft-backend.c:259:8:  [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(face_str));
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.c:164:19:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
                  strncat (family, token, (FONT_FAMILY_LEN - strlen (family)));
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.c:164:62:  [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).
                  strncat (family, token, (FONT_FAMILY_LEN - strlen (family)));
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.c:167:21:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is low because the source is a
  constant character.
                    strncat (family, " ", (FONT_FAMILY_LEN - strlen (family)));
data/matchbox-keyboard-0.2+git20160713/src/matchbox-keyboard.c:167:62:  [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).
                    strncat (family, " ", (FONT_FAMILY_LEN - strlen (family)));

ANALYSIS SUMMARY:

Hits = 42
Lines analyzed = 8282 in approximately 0.17 seconds (48574 lines/second)
Physical Source Lines of Code (SLOC) = 5800
Hits@level = [0]  30 [1]  12 [2]  11 [3]   9 [4]  10 [5]   0
Hits@level+ = [0+]  72 [1+]  42 [2+]  30 [3+]  19 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 12.4138 [1+] 7.24138 [2+] 5.17241 [3+] 3.27586 [4+] 1.72414 [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.