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/mxt-app-1.28/src/jni/com_atmel_Maxtouch_MaxtouchJni.h
Examining data/mxt-app-1.28/src/jni/jniinterface.c
Examining data/mxt-app-1.28/src/libmaxtouch/config.c
Examining data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c
Examining data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.h
Examining data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c
Examining data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.h
Examining data/mxt-app-1.28/src/libmaxtouch/info_block.c
Examining data/mxt-app-1.28/src/libmaxtouch/info_block.h
Examining data/mxt-app-1.28/src/libmaxtouch/libmaxtouch.c
Examining data/mxt-app-1.28/src/libmaxtouch/libmaxtouch.h
Examining data/mxt-app-1.28/src/libmaxtouch/log.c
Examining data/mxt-app-1.28/src/libmaxtouch/log.h
Examining data/mxt-app-1.28/src/libmaxtouch/msg.c
Examining data/mxt-app-1.28/src/libmaxtouch/msg.h
Examining data/mxt-app-1.28/src/libmaxtouch/sysfs/dmesg.c
Examining data/mxt-app-1.28/src/libmaxtouch/sysfs/dmesg.h
Examining data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c
Examining data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.h
Examining data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c
Examining data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.h
Examining data/mxt-app-1.28/src/libmaxtouch/utilfuncs.c
Examining data/mxt-app-1.28/src/libmaxtouch/utilfuncs.h
Examining data/mxt-app-1.28/src/mxt-app/broken_line.c
Examining data/mxt-app-1.28/src/mxt-app/broken_line.h
Examining data/mxt-app-1.28/src/mxt-app/buffer.c
Examining data/mxt-app-1.28/src/mxt-app/buffer.h
Examining data/mxt-app-1.28/src/mxt-app/diagnostic_data.c
Examining data/mxt-app-1.28/src/mxt-app/gr.c
Examining data/mxt-app-1.28/src/mxt-app/menu.c
Examining data/mxt-app-1.28/src/mxt-app/mxt_app.c
Examining data/mxt-app-1.28/src/mxt-app/mxt_app.h
Examining data/mxt-app-1.28/src/mxt-app/polyfit.c
Examining data/mxt-app-1.28/src/mxt-app/self_cap.c
Examining data/mxt-app-1.28/src/mxt-app/self_test.c
Examining data/mxt-app-1.28/src/mxt-app/sensor_variant.c
Examining data/mxt-app-1.28/src/mxt-app/sensor_variant.h
Examining data/mxt-app-1.28/src/mxt-app/serial_data.c
Examining data/mxt-app-1.28/src/mxt-app/signal.c
Examining data/mxt-app-1.28/src/mxt-app/touch_app.c
Examining data/mxt-app-1.28/src/mxt-app/bridge.c
Examining data/mxt-app-1.28/src/mxt-app/bootloader.c
Examining data/mxt-app-1.28/src/test/run_unit_tests.h
Examining data/mxt-app-1.28/src/test/test_sensor_variant.c
Examining data/mxt-app-1.28/src/test/test_utilfuncs.c
Examining data/mxt-app-1.28/src/test/run_unit_tests.c

FINAL RESULTS:

data/mxt-app-1.28/src/libmaxtouch/config.c:513:13:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
        if (fscanf(fp, "%s", tmp) != 1) {
data/mxt-app-1.28/src/libmaxtouch/config.c:527:9:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    if (fscanf(fp, "%s", tmp) != 1) {
data/mxt-app-1.28/src/libmaxtouch/log.c:146:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vprintf(format, va_args);
data/mxt-app-1.28/src/libmaxtouch/log.c:160:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(stderr, format, va_args);
data/mxt-app-1.28/src/libmaxtouch/log.h:65:57:  [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.
static inline void __attribute__((always_inline, format(printf, 2, 3)))
data/mxt-app-1.28/src/libmaxtouch/msg.c:74:12:  [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.
  length = snprintf(mxt->msg_string, sizeof(mxt->msg_string), MSG_PREFIX);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:227:16:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    } else if (sscanf(pEntry->d_name, "i2c-%s", acpi) == 1) {
data/mxt-app-1.28/src/mxt-app/bridge.c:130:14:  [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.
    length = snprintf(mxt->msg_string, sizeof(mxt->msg_string),
data/mxt-app-1.28/src/mxt-app/bridge.c:183: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(response, PREFIX);
data/mxt-app-1.28/src/mxt-app/bridge.c:276: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(response, PREFIX);
data/mxt-app-1.28/src/mxt-app/bridge.c:481:14:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
  } else if (sscanf(line, "REA %" SCNu16 " %" SCNu16, &address, &count) == 2) {
data/mxt-app-1.28/src/mxt-app/menu.c:116:9:  [4] (buffer) scanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
    if (scanf("%" SCNu16, &obj_num) != 1) {
data/mxt-app-1.28/src/mxt-app/menu.c:126:11:  [4] (buffer) scanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
      if (scanf("%" SCNu8, &instance) != 1) {
data/mxt-app-1.28/src/mxt-app/menu.c:179:11:  [4] (buffer) scanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
      if (scanf("%" SCNu8, &value) != 1) {
data/mxt-app-1.28/src/mxt-app/menu.c:200:9:  [4] (buffer) scanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
    if (scanf("%" SCNu16, &obj_num) != 1) {
data/mxt-app-1.28/src/mxt-app/menu.c:210:11:  [4] (buffer) scanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
      if (scanf("%" SCNu8, &instance) != 1) {
data/mxt-app-1.28/src/mxt-app/mxt_app.c:583:15:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
          if (sscanf(optarg, "hidraw:%s", conn->hidraw.node) != 1) {
data/mxt-app-1.28/src/mxt-app/touch_app.c:58:11:  [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.
    len = snprintf(mxt->msg_string, sizeof(mxt->msg_string), MSG_PREFIX);
data/mxt-app-1.28/src/mxt-app/mxt_app.c:294:9:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
    c = getopt_long(argc, argv,
data/mxt-app-1.28/src/libmaxtouch/config.c:174: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(obj_buf, objcfg->data, num_bytes);
data/mxt-app-1.28/src/libmaxtouch/config.c:232: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(&cfg->id, mxt->info.id, sizeof(struct mxt_id_info));
data/mxt-app-1.28/src/libmaxtouch/config.c:303: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).
  fp = fopen(filename, "w");
data/mxt-app-1.28/src/libmaxtouch/config.c:368: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).
  fp = fopen(filename, "w");
data/mxt-app-1.28/src/libmaxtouch/config.c:452: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 object[255];
data/mxt-app-1.28/src/libmaxtouch/config.c:453: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[255];
data/mxt-app-1.28/src/libmaxtouch/config.c:468: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).
  fp = fopen(filename, "r");
data/mxt-app-1.28/src/libmaxtouch/config.c:702: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[2048];
data/mxt-app-1.28/src/libmaxtouch/config.c:708: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).
  fp = fopen(filename, "r");
data/mxt-app-1.28/src/libmaxtouch/config.c:985: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(buffer + off, objcfg->data, objcfg->size);
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c:98: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[20];
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c:101:26:  [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).
  mxt->conn->hidraw.fd = open(filename, O_RDWR|O_NONBLOCK);
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c:244: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(buf + bytes_read, read_pkt.read_data, ret);
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c:283: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(write_pkt.write_data, val + bytes_written, write_pkt.rx_bytes);
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.h:36: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 node[20];
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:77: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[20];
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:80: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(filename, O_RDWR);
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:105: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 register_buf[2];
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:167: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 + 2, val, datalength);
data/mxt-app-1.28/src/libmaxtouch/info_block.c:243: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 firmware_version[MXT_FW_VER_LEN];
data/mxt-app-1.28/src/libmaxtouch/libmaxtouch.h:169: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 msg_string[255];
data/mxt-app-1.28/src/libmaxtouch/log.c:122:5:  [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(&hexbuf[3 * i], "%02X ", data[i]);
data/mxt-app-1.28/src/libmaxtouch/msg.c:68: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 databuf[20];
data/mxt-app-1.28/src/libmaxtouch/msg.c:124: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 databuf[20];
data/mxt-app-1.28/src/libmaxtouch/sysfs/dmesg.c:63: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 msg[BUFFERSIZE];
data/mxt-app-1.28/src/libmaxtouch/sysfs/dmesg.c:126: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 msg[BUFFERSIZE];
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:66:32:  [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).
  mxt->sysfs.debug_notify_fd = open(filename, O_RDONLY);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.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(c->sysfs.path, dir, strlen(dir) + 1);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:201: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 acpi[PATH_MAX];
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:349: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(mxt->sysfs.mem_access_path, O_RDWR);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:458: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(filename, "w+");
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:488: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(filename, "r");
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:562: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 databuf[20];
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:563:10:  [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_string[255];
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:601: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,
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:664: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(filename, O_RDWR);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:209: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:276:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  (void)memcpy(buf, &pkt[response_ofs + 2], count);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:289: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:338:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  (void)memcpy(pkt + cmd_size, buf, count);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:368: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[128];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:392: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[128];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:473: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:495: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:517: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:1048: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:1066:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  (void)memcpy(buf, &pkt[data_offset], count);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:1077: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:1090:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  (void)memcpy(&pkt[data_offset], buf, count);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:1125: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 pkt[mxt->usb.ep1_in_max_packet_size];
data/mxt-app-1.28/src/libmaxtouch/utilfuncs.c:203: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 databuf[BUF_SIZE];
data/mxt-app-1.28/src/libmaxtouch/utilfuncs.c:322: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 tmbuf[64];
data/mxt-app-1.28/src/mxt-app/bootloader.c:77: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 curr_version[MXT_FW_VER_LEN];
data/mxt-app-1.28/src/mxt-app/bootloader.c:129: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 buf[2];
data/mxt-app-1.28/src/mxt-app/bootloader.c:144: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 buf[2];
data/mxt-app-1.28/src/mxt-app/bootloader.c:157: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 buf[3];
data/mxt-app-1.28/src/mxt-app/bootloader.c:270: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 buffer[FIRMWARE_BUFFER_SIZE];
data/mxt-app-1.28/src/mxt-app/bootloader.c:565:11:  [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).
  fw.fp = fopen(filename, "r");
data/mxt-app-1.28/src/mxt-app/bootloader.c:705: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 buf[3];
data/mxt-app-1.28/src/mxt-app/bridge.c:113: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 databuf[20];
data/mxt-app-1.28/src/mxt-app/bridge.c:187:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(response + strlen(PREFIX), "ERR\n");
data/mxt-app-1.28/src/mxt-app/bridge.c:191:7:  [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(response + strlen(PREFIX) + i*2, "%02X", databuf[i]);
data/mxt-app-1.28/src/mxt-app/bridge.c:280:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(response + strlen(PREFIX), "ERR\n");
data/mxt-app-1.28/src/mxt-app/bridge.c:284:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy(response + strlen(PREFIX), "OK\n");
data/mxt-app-1.28/src/mxt-app/bridge.c:628:3:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  bcopy((char *)server->h_addr,
data/mxt-app-1.28/src/mxt-app/diagnostic_data.c:642: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).
  ctx.hawkeye = fopen(csv_file,"w");
data/mxt-app-1.28/src/mxt-app/diagnostic_data.c:720: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 csv_file_in[MAX_FILENAME_LENGTH + 1];
data/mxt-app-1.28/src/mxt-app/menu.c:51: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 cfg_file[255];
data/mxt-app-1.28/src/mxt-app/menu.c:73: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 cfg_file[255];
data/mxt-app-1.28/src/mxt-app/menu.c:93: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 fw_file[255];
data/mxt-app-1.28/src/mxt-app/menu.c:225: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_buf[8];
data/mxt-app-1.28/src/mxt-app/mxt_app.c:213: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 strbuf2[BUF_SIZE];
data/mxt-app-1.28/src/mxt-app/mxt_app.c:214: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 strbuf[BUF_SIZE];
data/mxt-app-1.28/src/mxt-app/mxt_app.c:526:26:  [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).
        i2c_block_size = atoi(optarg);
data/mxt-app-1.28/src/mxt-app/mxt_app.c:561:11:  [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(conn->sysfs.path, optarg + 6, strlen(optarg) - 6);
data/mxt-app-1.28/src/mxt-app/serial_data.c:158: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];
data/mxt-app-1.28/src/mxt-app/serial_data.c:163: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).
  fp = fopen(ctx->filename, "r");
data/mxt-app-1.28/src/test/test_utilfuncs.c:46: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 hex[5];
data/mxt-app-1.28/src/test/test_utilfuncs.c:51:3:  [2] (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). Risk is low because the source is a constant string.
  strcpy(hex, "09");
data/mxt-app-1.28/src/test/test_utilfuncs.c:57:3:  [2] (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). Risk is low because the source is a constant string.
  strcpy(hex, "0F");
data/mxt-app-1.28/src/test/test_utilfuncs.c:63:3:  [2] (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). Risk is low because the source is a constant string.
  strcpy(hex, "0FAB");
data/mxt-app-1.28/src/test/test_utilfuncs.c:75:3:  [2] (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). Risk is low because the source is a constant string.
  strcpy(hex, "0FAB");
data/mxt-app-1.28/src/test/test_utilfuncs.c:79:3:  [2] (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). Risk is low because the source is a constant string.
  strcpy(hex, "0xA5");
data/mxt-app-1.28/src/libmaxtouch/config.c:476:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:478:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:547:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:556:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:559:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:567:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:569:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:577:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:623:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:625:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:652:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:661:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(fp);
data/mxt-app-1.28/src/libmaxtouch/config.c:718:36:  [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 (strncmp(line, OBP_RAW_MAGIC, strlen(OBP_RAW_MAGIC))) {
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c:129:5:  [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(HIDRAW_WRITE_RETRY_DELAY_US);
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c:177:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret = read(mxt->conn->hidraw.fd, read_pkt + t_count, count);
data/mxt-app-1.28/src/libmaxtouch/hidraw/hidraw_device.c:185:5:  [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(HIDRAW_READ_RETRY_DELAY_US);
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:119:5:  [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(I2C_RETRY_DELAY);
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:128:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  read_rc = read(fd, buf, count);
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:171:5:  [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(I2C_RETRY_DELAY);
data/mxt-app-1.28/src/libmaxtouch/i2c_dev/i2c_dev_device.c:201:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read(fd, buf, count) != count) {
data/mxt-app-1.28/src/libmaxtouch/sysfs/dmesg.c:81:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(new_node->msg, msg, sizeof(new_node->msg));
data/mxt-app-1.28/src/libmaxtouch/sysfs/dmesg.c:250:36:  [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 (strncmp(MSG_PREFIX, message, strlen(MSG_PREFIX))) {
data/mxt-app-1.28/src/libmaxtouch/sysfs/dmesg.c:255: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).
  message += strlen(MSG_PREFIX);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:83:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  read(mxt->sysfs.debug_notify_fd, &val, 2);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:100: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).
  c->sysfs.path = (char *)calloc(strlen(dir) + 1, sizeof(char));
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:101:30:  [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).
  memcpy(c->sysfs.path, dir, strlen(dir) + 1);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:134: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).
  length = strlen(dir) + strlen(i2c_dir->d_name) + 2;
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:134: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).
  length = strlen(dir) + strlen(i2c_dir->d_name) + 2;
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:204: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).
  length = strlen(path) + strlen(dir->d_name) + 1;
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:204: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).
  length = strlen(path) + strlen(dir->d_name) + 1;
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:287: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).
  mxt->sysfs.path_max = strlen(conn->path) + 20;
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:383:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret = read(fd, buf + *bytes_read, count - *bytes_read);
data/mxt-app-1.28/src/libmaxtouch/sysfs/sysfs_device.c:673:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  num_bytes = read(fd, mxt->sysfs.debug_v2_msg_buf, mxt->sysfs.debug_v2_size);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:658:5:  [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(500000);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:985:5:  [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(500000);
data/mxt-app-1.28/src/libmaxtouch/usb/usb_device.c:1000:5:  [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(500000);
data/mxt-app-1.28/src/mxt-app/bootloader.c:110: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(1000);
data/mxt-app-1.28/src/mxt-app/bootloader.c:117:5:  [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(MXT_BOOTLOADER_DELAY);
data/mxt-app-1.28/src/mxt-app/bootloader.c:253:12:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  str[0] = fgetc(fw->fp);
data/mxt-app-1.28/src/mxt-app/bootloader.c:254:12:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  str[1] = fgetc(fw->fp);
data/mxt-app-1.28/src/mxt-app/bootloader.c:579: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).
    if (strlen(new_version) > 0) {
data/mxt-app-1.28/src/mxt-app/bridge.c:75:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    readcount = read(fd, &c, 1);
data/mxt-app-1.28/src/mxt-app/bridge.c:139: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).
    ret = write(bridge_ctx->sockfd, mxt->msg_string, strlen(mxt->msg_string));
data/mxt-app-1.28/src/mxt-app/bridge.c:175: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).
  response_len = strlen(PREFIX) + count*2 + 1;
data/mxt-app-1.28/src/mxt-app/bridge.c:187: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).
    strcpy(response + strlen(PREFIX), "ERR\n");
data/mxt-app-1.28/src/mxt-app/bridge.c:188:20:  [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).
    response_len = strlen(response);
data/mxt-app-1.28/src/mxt-app/bridge.c:191: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).
      sprintf(response + strlen(PREFIX) + i*2, "%02X", databuf[i]);
data/mxt-app-1.28/src/mxt-app/bridge.c:245: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).
  ret = write(bridge_ctx->sockfd, response, strlen(response));
data/mxt-app-1.28/src/mxt-app/bridge.c:280: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).
    strcpy(response + strlen(PREFIX), "ERR\n");
data/mxt-app-1.28/src/mxt-app/bridge.c:281:20:  [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).
    response_len = strlen(response);
data/mxt-app-1.28/src/mxt-app/bridge.c:284: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).
    strcpy(response + strlen(PREFIX), "OK\n");
data/mxt-app-1.28/src/mxt-app/bridge.c:285:20:  [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).
    response_len = strlen(response);
data/mxt-app-1.28/src/mxt-app/bridge.c:316: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).
  ret = write(bridge_ctx->sockfd, outstr, strlen(outstr));
data/mxt-app-1.28/src/mxt-app/bridge.c:373: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).
  ret = write(bridge_ctx->sockfd, outstr, strlen(outstr));
data/mxt-app-1.28/src/mxt-app/bridge.c:413:40:  [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).
  ret = write(bridge_ctx->sockfd, msg, strlen(msg));
data/mxt-app-1.28/src/mxt-app/bridge.c:431:40:  [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).
  ret = write(bridge_ctx->sockfd, msg, strlen(msg));
data/mxt-app-1.28/src/mxt-app/bridge.c:468: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(line) == 0) {
data/mxt-app-1.28/src/mxt-app/bridge.c:489: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).
                         strlen(line) - offset);
data/mxt-app-1.28/src/mxt-app/bridge.c:505: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).
    ret = write(bridge_ctx->sockfd, msgcfg_response, strlen(msgcfg_response));
data/mxt-app-1.28/src/mxt-app/bridge.c:512: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).
  } else if (!strncmp(line, info_cmd, strlen(info_cmd))) {
data/mxt-app-1.28/src/mxt-app/bridge.c:513:51:  [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).
    ret = bridge_info_cmd(mxt, bridge_ctx, line + strlen(info_cmd));
data/mxt-app-1.28/src/mxt-app/bridge.c:515:50:  [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).
    ret = write(bridge_ctx->sockfd, unknown_cmd, strlen(unknown_cmd));
data/mxt-app-1.28/src/mxt-app/diagnostic_data.c:117:5:  [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(500);
data/mxt-app-1.28/src/mxt-app/diagnostic_data.c:728:9:  [1] (buffer) scanf:
  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.
    if (scanf("%1s", &menu_input) == EOF) {
data/mxt-app-1.28/src/mxt-app/diagnostic_data.c:739:9:  [1] (buffer) scanf:
  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.
    if (scanf("%255s", csv_file_in) == EOF) {
data/mxt-app-1.28/src/mxt-app/menu.c:55:7:  [1] (buffer) scanf:
  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.
  if (scanf("%255s", cfg_file) != 1) {
data/mxt-app-1.28/src/mxt-app/menu.c:77:7:  [1] (buffer) scanf:
  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.
  if (scanf("%255s", cfg_file) != 1) {
data/mxt-app-1.28/src/mxt-app/menu.c:98:7:  [1] (buffer) scanf:
  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.
  if (scanf("%255s", fw_file) != 1) {
data/mxt-app-1.28/src/mxt-app/menu.c:345:11:  [1] (buffer) scanf:
  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.
    ret = scanf("%1s", &menu_input);
data/mxt-app-1.28/src/mxt-app/mxt_app.c:305:11:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:316:11:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:347:11:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:391:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:464:11:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:473:11:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:496:11:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
          strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:510:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(strbuf2, optarg, sizeof(strbuf2));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:554: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).
          conn->sysfs.path = (char *)calloc(strlen(optarg) + 1, sizeof(char));
data/mxt-app-1.28/src/mxt-app/mxt_app.c:561: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).
          memcpy(conn->sysfs.path, optarg + 6, strlen(optarg) - 6);
data/mxt-app-1.28/src/mxt-app/mxt_app.c:599:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(strbuf, optarg, sizeof(strbuf));
data/mxt-app-1.28/src/mxt-app/serial_data.c:177:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getc(fp);
data/mxt-app-1.28/src/mxt-app/serial_data.c:206:13:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        c = getc(fp);
data/mxt-app-1.28/src/mxt-app/serial_data.c:212:11:  [1] (buffer) fscanf:
  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.
      if (fscanf(fp, "x%2su", (char *)&buf) != 1) {
data/mxt-app-1.28/src/test/test_utilfuncs.c:71:3:  [1] (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). Risk is low because the source is a constant character.
  strcpy(hex, "F");

ANALYSIS SUMMARY:

Hits = 186
Lines analyzed = 14071 in approximately 0.35 seconds (39700 lines/second)
Physical Source Lines of Code (SLOC) = 9394
Hits@level = [0] 175 [1]  84 [2]  83 [3]   1 [4]  18 [5]   0
Hits@level+ = [0+] 361 [1+] 186 [2+] 102 [3+]  19 [4+]  18 [5+]   0
Hits/KSLOC@level+ = [0+] 38.4288 [1+] 19.7999 [2+] 10.858 [3+] 2.02257 [4+] 1.91612 [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.