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/libmatchbox-1.12+git20170224/tests/unicode.c
Examining data/libmatchbox-1.12+git20170224/tests/dump-image.c
Examining data/libmatchbox-1.12+git20170224/tests/oh.h
Examining data/libmatchbox-1.12+git20170224/tests/dot-desktop.c
Examining data/libmatchbox-1.12+git20170224/tests/pixbuf.c
Examining data/libmatchbox-1.12+git20170224/libmb/hash.h
Examining data/libmatchbox-1.12+git20170224/libmb/mb.h
Examining data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.h
Examining data/libmatchbox-1.12+git20170224/libmb/mbexp.h
Examining data/libmatchbox-1.12+git20170224/libmb/mbmenu.h
Examining data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.h
Examining data/libmatchbox-1.12+git20170224/libmb/hash.c
Examining data/libmatchbox-1.12+git20170224/libmb/xsettings-common.h
Examining data/libmatchbox-1.12+git20170224/libmb/mbtray.c
Examining data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c
Examining data/libmatchbox-1.12+git20170224/libmb/xsettings-common.c
Examining data/libmatchbox-1.12+git20170224/libmb/mbexp.c
Examining data/libmatchbox-1.12+git20170224/libmb/mbutil.h
Examining data/libmatchbox-1.12+git20170224/libmb/mbutil.c
Examining data/libmatchbox-1.12+git20170224/libmb/xsettings-client.h
Examining data/libmatchbox-1.12+git20170224/libmb/xsettings-client.c
Examining data/libmatchbox-1.12+git20170224/libmb/mbtray.h
Examining data/libmatchbox-1.12+git20170224/libmb/mbmenu.c
Examining data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c

FINAL RESULTS:

data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:277:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(icon_dirs[0], "%s/.icons", mb_util_get_homedir());
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:280:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
  sprintf(icon_dirs[1], DATADIR "/icons");
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:367: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, 512, DATADIR "/pixmaps/%s", icon_name);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:1042:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy((char*)str, (char*)txt);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:1208:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy((char*)str, (char*)text);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:1294:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy((char*)str, (char*)text);
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:33:32:  [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 MENUDBG(txt, args... ) fprintf(stderr, "MENU DEBUG: " txt , ##args )
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:704:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(app_cfg, value);
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:1070:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(menu->title, title);
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:1117:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(menu_item->info, info);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:457:6:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
					strcat(col, s);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:489:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
				  strcpy(tok, s);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:496:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
				  strcat(col, s);
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:95:8:  [4] (shell) execvp:
  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.
  rc = execvp (argv[0], argv);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:880:27:  [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 ((pb->depth < 24 && !getenv("MBPIXBUF_FORCE_32BPP_INTERNAL"))
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:881:10:  [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.
      || getenv("MBPIXBUF_FORCE_16BPP_INTERNAL"))
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:906:39:  [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 (!XShmQueryExtension(pb->dpy) || getenv("MBPIXBUF_NO_SHM")) 
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:596: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_SYNC"))
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1197: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("SYSTEM_TRAY_ID"))
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1198:24:  [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.
    mb->tray_id = atoi(getenv("SYSTEM_TRAY_ID"));
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:233: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") == NULL)
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:235:11:  [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("TMPDIR"))
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:236:16:  [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.
        return getenv("TMPDIR");
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:241:10:  [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.
  return getenv("HOME");
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:378: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.
    env_checked = getenv("MB_WARNINGS") ? 1 : 2;
data/libmatchbox-1.12+git20170224/tests/pixbuf.c:49:22:  [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.
  dpy = XOpenDisplay(getenv("DISPLAY"));
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:50: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 data[256];
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:53:14:  [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 (!(fp = fopen(dd->filename, "r"))) return DD_ERROR_FILE_OPEN_FAILED;
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:78: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.
	      char new_key[65], locale[17];
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:270: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_path[512] = { 0 };
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:274: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 *icon_dirs[2] = { NULL, NULL };
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:299: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.
	      char dd_filename[512] = { 0 };
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:396: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 data[512];
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:397: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 order_path[256];
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:404:14:  [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 (!(fp = fopen(order_path, "r"))) 
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:437: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 tmp_path[512] = { 0 };
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:301: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 font_spec[256];
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:555:39:  [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_font_set_size_to_pixels(font, atoi(token), NULL);	    
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:557:35:  [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_font_set_point_size(font, atoi(token));
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:688: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 app_cfg[256];
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:705:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(app_cfg, "/theme.desktop");
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:159:17:  [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 ((infile = fopen(file, "rb")) == NULL) {
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:205: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( &data[ ( cinfo.output_scanline - 1 ) * row_stride ], 
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:227: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/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:236: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/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:336: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.
    unsigned char       str[6];
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:346: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 *line, s[257], tok[128], col[256];
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:355:15:  [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 ((file = fopen( filename, "rb" )) == NULL) return NULL;
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:1102:7:  [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(img->rgba, data, width*height*(3+has_alpha));
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:1357: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(img_new->rgba, img->rgba, 
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:281:8:  [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(&tv_tmp, mb->poll_timeout, sizeof(struct timeval));
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:325: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(mb->poll_timeout, tv, sizeof(struct timeval));
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:405: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(mb->poll_timeout, tv, sizeof(struct timeval));
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:555:17:  [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->offset = atoi((*argv)[i+1]);
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:851:33:  [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).
	  Pixmap foreign_pxm = (Pixmap)atol(value+4);
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:890:25:  [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).
	  xcol.pixel = (Pixmap)atol(value+4);
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:956: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(ev.xclient.data.b, data, sizeof(unsigned char)*20);
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1147:13:  [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 buf[20];
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1158: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(buf, &msg[bytes_sent], sizeof(unsigned char)*20);
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1160: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(buf, &msg[bytes_sent],
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1194: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 tray_atom_spec[128];
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1198: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).
    mb->tray_id = atoi(getenv("SYSTEM_TRAY_ID"));
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:32: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 *argv[MAX_ARGS + 1];
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:157:16:  [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_found = atoi((char*)value); /* XXX should check window ID 
data/libmatchbox-1.12+git20170224/libmb/xsettings-client.c:258:7:  [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 (setting->name, buffer.pos, name_len);
data/libmatchbox-1.12+git20170224/libmb/xsettings-client.c:296: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 (setting->data.v_string, buffer.pos, v_int);
data/libmatchbox-1.12+git20170224/libmb/xsettings-client.c:458: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 buffer[256];
data/libmatchbox-1.12+git20170224/libmb/xsettings-client.c:459: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 *atom_names[3];
data/libmatchbox-1.12+git20170224/libmb/xsettings-client.c:477: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(buffer, "_XSETTINGS_S%d", screen);
data/libmatchbox-1.12+git20170224/libmb/xsettings-common.c:46: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 (result->name, setting->name, str_len + 1);
data/libmatchbox-1.12+git20170224/libmb/xsettings-common.c:64:7:  [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 (result->data.v_string, setting->data.v_string, str_len + 1);
data/libmatchbox-1.12+git20170224/tests/pixbuf.c:34:7:  [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("dump.raw", "wb");
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:82: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).
	      while (isspace(key[strlen(key)-1])) key[strlen(key)-1] = '\0'; 
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:82:48:  [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).
	      while (isspace(key[strlen(key)-1])) key[strlen(key)-1] = '\0'; 
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:84: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).
	      while (isspace(val[strlen(val)-1])) val[strlen(val)-1] = '\0'; 
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:84:48:  [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).
	      while (isspace(val[strlen(val)-1])) val[strlen(val)-1] = '\0'; 
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:101:16:  [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 (val[strlen(val)-1] == '\n') val[strlen(val)-1] = '\0';
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:101:44:  [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 (val[strlen(val)-1] == '\n') val[strlen(val)-1] = '\0';
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:120:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(result, src, n);
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:157:26:  [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).
      end_pos = locale + strlen (locale);
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:210: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).
  d = dest = malloc (strlen(source) + 1);
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:276: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).
  icon_dirs[0] = alloca(sizeof(char) * (strlen(mb_util_get_homedir()) + 8));
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:279: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).
  icon_dirs[1] = alloca(sizeof(char) * (strlen(DATADIR) + 8));
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:286:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(theme_name_cur, theme_name, 512);  
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:353:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		      strncpy(theme_name_cur, 
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:439:16:  [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 (data[strlen(data)-1] == '\n') data[strlen(data)-1] = '\0';
data/libmatchbox-1.12+git20170224/libmb/mbdotdesktop.c:439:46:  [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 (data[strlen(data)-1] == '\n') data[strlen(data)-1] = '\0';
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:93: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).
	      if (strlen(spec) == 9)
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:554: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 (token[strlen(token)-1] == 'x')
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:803: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(str), attr_list, NULL);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:921: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).
  int            bytelen = strlen((char*)txt);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:965: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 ((char*)txt), attr_list, NULL);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:1031: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((char*)txt);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:1203: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((char*)text);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:1289: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((char*)text);
data/libmatchbox-1.12+git20170224/libmb/mbexp.c:1468:55:  [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).
	  cur_width = mb_font_get_txt_width(layout->font, q, strlen((char*)q), 
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:117:34:  [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 (setting->data.v_string && strlen(setting->data.v_string))
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:1069:47:  [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).
   menu->title = (char *)malloc(sizeof(char)*(strlen(title)+1));
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:1116: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).
      menu_item->info = (char *)malloc(sizeof(char)*(strlen(info)+1));
data/libmatchbox-1.12+git20170224/libmb/mbmenu.c:1253: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(tmp_title),
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:362:11:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = fgetc(file);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:433: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(line);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:434:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		      strncpy((char*)cmap[j].str, line, cpp);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:443:10:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
			      sscanf(&line[k], "%256s", s);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:444:17:  [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).
			      slen = strlen(s);
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:455:6:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
					strcat(col, " ");
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:456: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 (strlen(col) + strlen(s) < sizeof(col))
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:456: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).
                                      if (strlen(col) + strlen(s) < sizeof(col))
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:495:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
				    strcat(col, " ");
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:1410: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).
  if (!strcasecmp(&filename[strlen(filename)-4], ".png"))
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:1416: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).
  if (!strcasecmp(&filename[strlen(filename)-4], ".jpg")
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:1417:32:  [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).
      || !strcasecmp(&filename[strlen(filename)-5], ".jpeg"))
data/libmatchbox-1.12+git20170224/libmb/mbpixbuf.c:1422: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).
if (!strcasecmp(&filename[strlen(filename)-4], ".xpm"))
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:845:45:  [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 (status == Success && value != NULL && strlen(value) > 4)
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1017: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).
		   PropModeReplace, mb->app_name, strlen((char*)mb->app_name));
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1030: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).
		       mb->context_info, strlen((char*)mb->context_info));
data/libmatchbox-1.12+git20170224/libmb/mbtray.c:1148: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).
   int msg_len = strlen((char*)msg);
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:31: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).
  char *buf = alloca (strlen (cmd) + 1), *bufp = buf;
data/libmatchbox-1.12+git20170224/libmb/mbutil.c:340:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(1);
data/libmatchbox-1.12+git20170224/libmb/xsettings-common.c:41: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).
  str_len = strlen (setting->name);
data/libmatchbox-1.12+git20170224/libmb/xsettings-common.c:59:17:  [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_len = strlen (setting->data.v_string);

ANALYSIS SUMMARY:

Hits = 121
Lines analyzed = 12963 in approximately 0.32 seconds (39992 lines/second)
Physical Source Lines of Code (SLOC) = 8680
Hits@level = [0]  59 [1]  49 [2]  46 [3]  12 [4]  14 [5]   0
Hits@level+ = [0+] 180 [1+] 121 [2+]  72 [3+]  26 [4+]  14 [5+]   0
Hits/KSLOC@level+ = [0+] 20.7373 [1+] 13.9401 [2+] 8.29493 [3+] 2.99539 [4+] 1.6129 [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.