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/gpm-1.20.7/contrib/other/TPdetect.cc
Examining data/gpm-1.20.7/contrib/control/gpm_has_mouse_control.c
Examining data/gpm-1.20.7/src/daemon/build_argv.c
Examining data/gpm-1.20.7/src/daemon/check_kill.c
Examining data/gpm-1.20.7/src/daemon/check_uniqueness.c
Examining data/gpm-1.20.7/src/daemon/disable_paste.c
Examining data/gpm-1.20.7/src/daemon/do_client.c
Examining data/gpm-1.20.7/src/daemon/do_selection.c
Examining data/gpm-1.20.7/src/daemon/find_mouse_by_name.c
Examining data/gpm-1.20.7/src/daemon/get_console_size.c
Examining data/gpm-1.20.7/src/daemon/get_data.c
Examining data/gpm-1.20.7/src/daemon/gpm-killed.c
Examining data/gpm-1.20.7/src/daemon/gpm_exited.c
Examining data/gpm-1.20.7/src/daemon/header.c
Examining data/gpm-1.20.7/src/daemon/init_mice.c
Examining data/gpm-1.20.7/src/daemon/loadlut.c
Examining data/gpm-1.20.7/src/daemon/main.c
Examining data/gpm-1.20.7/src/daemon/processspecial.c
Examining data/gpm-1.20.7/src/daemon/reset_mice.c
Examining data/gpm-1.20.7/src/daemon/selection_copy.c
Examining data/gpm-1.20.7/src/daemon/selection_paste.c
Examining data/gpm-1.20.7/src/daemon/usage.c
Examining data/gpm-1.20.7/src/daemon/wait_text.c
Examining data/gpm-1.20.7/src/daemon/cmdline.c
Examining data/gpm-1.20.7/src/daemon/getmousedata.c
Examining data/gpm-1.20.7/src/daemon/add_mouse.c
Examining data/gpm-1.20.7/src/daemon/startup.c
Examining data/gpm-1.20.7/src/daemon/processmouse.c
Examining data/gpm-1.20.7/src/daemon/gpm.c
Examining data/gpm-1.20.7/src/daemon/processrequest.c
Examining data/gpm-1.20.7/src/daemon/processconn.c
Examining data/gpm-1.20.7/src/daemon/old_main.c
Examining data/gpm-1.20.7/src/daemon/open_console.c
Examining data/gpm-1.20.7/src/generic/getsym.c
Examining data/gpm-1.20.7/src/generic/isodigit.c
Examining data/gpm-1.20.7/src/gpm2/core/main.c
Examining data/gpm-1.20.7/src/gpm2/core/read_config.c
Examining data/gpm-1.20.7/src/gpm2/core/set_defaults.c
Examining data/gpm-1.20.7/src/gpm2/generic/commandline.c
Examining data/gpm-1.20.7/src/gpm2/generic/daemon-usage.c
Examining data/gpm-1.20.7/src/gpm2/generic/mini_printf.c
Examining data/gpm-1.20.7/src/gpm2/generic/read_packet.c
Examining data/gpm-1.20.7/src/gpm2/include/gpm2-client.h
Examining data/gpm-1.20.7/src/gpm2/include/gpm2-config.h
Examining data/gpm-1.20.7/src/gpm2/include/gpm2-daemon.h
Examining data/gpm-1.20.7/src/gpm2/include/gpm2-data.h
Examining data/gpm-1.20.7/src/gpm2/include/gpm2-generic.h
Examining data/gpm-1.20.7/src/gpm2/include/gpm2-io.h
Examining data/gpm-1.20.7/src/gpm2/mice/init_mice_handler.c
Examining data/gpm-1.20.7/src/gpm2/mice/mice_handler.c
Examining data/gpm-1.20.7/src/gpm2/mice/ps2.c
Examining data/gpm-1.20.7/src/headers/gpm-proto.h
Examining data/gpm-1.20.7/src/headers/gpm.h
Examining data/gpm-1.20.7/src/headers/synaptics.h
Examining data/gpm-1.20.7/src/headers/twiddler.h
Examining data/gpm-1.20.7/src/headers/message.h
Examining data/gpm-1.20.7/src/headers/gpmCfg.h
Examining data/gpm-1.20.7/src/headers/gpmInt.h
Examining data/gpm-1.20.7/src/headers/daemon.h
Examining data/gpm-1.20.7/src/lib/libhigh.c
Examining data/gpm-1.20.7/src/lib/libxtra.c
Examining data/gpm-1.20.7/src/lib/liblow.c
Examining data/gpm-1.20.7/src/lib/libcurses.c
Examining data/gpm-1.20.7/src/lib/report-lib.c
Examining data/gpm-1.20.7/src/prog/disable-paste.c
Examining data/gpm-1.20.7/src/prog/display-buttons.c
Examining data/gpm-1.20.7/src/prog/display-coords.c
Examining data/gpm-1.20.7/src/prog/get-versions.c
Examining data/gpm-1.20.7/src/prog/hltest.c
Examining data/gpm-1.20.7/src/prog/mev.c
Examining data/gpm-1.20.7/src/prog/open_console.c
Examining data/gpm-1.20.7/src/prog/mouse-test.c
Examining data/gpm-1.20.7/src/report.c
Examining data/gpm-1.20.7/src/tools.c
Examining data/gpm-1.20.7/src/twiddler.c
Examining data/gpm-1.20.7/src/mice.c
Examining data/gpm-1.20.7/src/synaptics.c

FINAL RESULTS:

data/gpm-1.20.7/src/daemon/old_main.c:99:4:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
   chmod(GPM_NODE_CTL,0777);
data/gpm-1.20.7/src/daemon/cmdline.c:87:20:  [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.
         case 'v': printf(GPM_MESS_VERSION "\n");        exit(0);
data/gpm-1.20.7/src/daemon/loadlut.c:69: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(option.consolename,GPM_SYS_CONSOLE);
data/gpm-1.20.7/src/daemon/old_main.c:90: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(ctladdr.sun_path,GPM_NODE_CTL);
data/gpm-1.20.7/src/daemon/processspecial.c:162:7:  [4] (shell) execl:
  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.
      execl("/bin/sh","sh","-c",command,(char *)NULL);
data/gpm-1.20.7/src/daemon/usage.c:31:4:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   printf(GPM_MESS_USAGE,option.progname, DEF_ACCEL, DEF_BAUD, DEF_SEQUENCE,
data/gpm-1.20.7/src/lib/liblow.c:331: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(addr.sun_path, GPM_NODE_CTL);
data/gpm-1.20.7/src/lib/libxtra.c:61:11:  [4] (shell) popen:
  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.
      f = popen(SBINDIR "/gpm -v", "r");
data/gpm-1.20.7/src/lib/libxtra.c:67:7:  [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.
      sscanf(line, "%*s %s", gpm_ver_s);        /* "gpm-Linux 0.98, March 1995" 
data/gpm-1.20.7/src/lib/report-lib.c:54:4:  [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,text,ap);
data/gpm-1.20.7/src/mice.c:2590:4:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   printf(GPM_MESS_VERSION "\n");
data/gpm-1.20.7/src/mice.c:2591:4:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   printf(GPM_MESS_AVAIL_MYT);
data/gpm-1.20.7/src/mice.c:2593:7:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      printf(GPM_MESS_SYNONYM, type->repeat_fun?'*':' ',
data/gpm-1.20.7/src/prog/hltest.c:453:8:  [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(s,"/dev/tty%d%s",&vc,t)!=1) {
data/gpm-1.20.7/src/prog/hltest.c:454:11:  [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(s,"/dev/vc/%d%s",&vc,t)!=1) {
data/gpm-1.20.7/src/prog/mev.c:170: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(buffer, s_mod[event->modifiers & ALL_KEY_MODS]);
data/gpm-1.20.7/src/prog/mev.c:175:13:  [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(buffer,s_multi[i]);
data/gpm-1.20.7/src/prog/mev.c:191:10:  [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(buffer,s_type[i]);
data/gpm-1.20.7/src/prog/mev.c:199:13:  [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(buffer,s_button[i]);
data/gpm-1.20.7/src/prog/mouse-test.c:320:9:  [4] (shell) popen:
  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.
      f=popen("ls -l /dev/* | "
data/gpm-1.20.7/src/report.c:92:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO);
data/gpm-1.20.7/src/report.c:95:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(stderr,GPM_STRING_INFO);
data/gpm-1.20.7/src/report.c:96:16:  [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,text,ap);
data/gpm-1.20.7/src/report.c:103:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN);
data/gpm-1.20.7/src/report.c:106:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(stderr,GPM_STRING_WARN);
data/gpm-1.20.7/src/report.c:107:16:  [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,text,ap);
data/gpm-1.20.7/src/report.c:114:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR);
data/gpm-1.20.7/src/report.c:117:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(stderr,GPM_STRING_ERR);
data/gpm-1.20.7/src/report.c:118:16:  [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,text,ap);
data/gpm-1.20.7/src/report.c:125:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS);
data/gpm-1.20.7/src/report.c:128:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(stderr,GPM_STRING_OOPS);
data/gpm-1.20.7/src/report.c:129:16:  [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,text,ap);
data/gpm-1.20.7/src/report.c:142:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_INFO | LOG_USER, GPM_STRING_INFO);
data/gpm-1.20.7/src/report.c:149:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_DAEMON | LOG_WARNING, GPM_STRING_WARN);
data/gpm-1.20.7/src/report.c:153:19:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                  fprintf(console,GPM_STRING_WARN);
data/gpm-1.20.7/src/report.c:154:19:  [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(console,text,ap);
data/gpm-1.20.7/src/report.c:163:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_ERR);
data/gpm-1.20.7/src/report.c:167:19:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                  fprintf(console,GPM_STRING_ERR);
data/gpm-1.20.7/src/report.c:168:19:  [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(console,text,ap);
data/gpm-1.20.7/src/report.c:174:19:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
                  fprintf(console,GPM_STRING_ERR);
data/gpm-1.20.7/src/report.c:175:19:  [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(console,text,ap3);
data/gpm-1.20.7/src/report.c:184:16:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
               syslog(LOG_DAEMON | LOG_ERR, GPM_STRING_OOPS);
data/gpm-1.20.7/src/report.c:187:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(stderr,GPM_STRING_OOPS);
data/gpm-1.20.7/src/report.c:188:16:  [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,text,ap);
data/gpm-1.20.7/src/report.c:201:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(console,GPM_STRING_INFO); break;
data/gpm-1.20.7/src/report.c:204:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(console,GPM_STRING_WARN); break;
data/gpm-1.20.7/src/report.c:207:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(console,GPM_STRING_ERR); break;
data/gpm-1.20.7/src/report.c:210:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(console,GPM_STRING_DEBUG); break;
data/gpm-1.20.7/src/report.c:213:16:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
               fprintf(console,GPM_STRING_OOPS); break;
data/gpm-1.20.7/src/report.c:216:10:  [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(console,text,ap);
data/gpm-1.20.7/src/synaptics.c:2080: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.
  status = snprintf(full_filename,100,SYSCONFDIR "/%s",config_filename);
data/gpm-1.20.7/src/tools.c:55:10:  [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(back,tmp);
data/gpm-1.20.7/src/twiddler.c:180:10:  [4] (shell) execl:
  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.
         execl("/bin/sh", "sh", "-c", s, NULL);
data/gpm-1.20.7/src/twiddler.c:486: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 (sscanf(s,"%s = %s",chord,buf)==2) /* M00L = anything */
data/gpm-1.20.7/src/twiddler.c:488:19:  [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(s, "%s %s = %s", mod, chord, buf)==3) /*Mod M00L =k */;
data/gpm-1.20.7/src/twiddler.c:489:19:  [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(s, "%s", buf)!= 0) {
data/gpm-1.20.7/src/daemon/cmdline.c:42:18:  [3] (buffer) getopt:
  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.
   while ((opt = getopt(argc, argv, options)) != -1) {
data/gpm-1.20.7/src/gpm2/generic/commandline.c:32:17:  [3] (buffer) getopt:
  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.
   while((opt = getopt(argc,argv,GPM2_ARGS)) != -1) {
data/gpm-1.20.7/src/lib/liblow.c:221: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.
   if ((term=(char *)getenv("TERM")) && !strncmp(term,"xterm",5)) {
data/gpm-1.20.7/src/lib/liblow.c:317:25:  [3] (tmpfile) tempnam:
  Temporary file race condition (CWE-377).
      if (!(sock_name = tempnam (0, "gpm"))) {
data/gpm-1.20.7/src/prog/mev.c:313:18:  [3] (buffer) getopt:
  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.
   while ((opt = getopt(argc, argv, options)) != -1)
data/gpm-1.20.7/contrib/control/gpm_has_mouse_control.c:11:10:  [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 ("/dev/tty0", O_RDONLY);
data/gpm-1.20.7/contrib/control/gpm_has_mouse_control.c:13:7:  [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 ("/dev/vc/0", O_RDONLY);
data/gpm-1.20.7/contrib/other/TPdetect.cc:265:12:  [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).
  int fd = open("/dev/psaux", O_RDWR);
data/gpm-1.20.7/src/daemon/check_kill.c:35: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).
   FILE* fp = fopen(GPM_NODE_PID, "r");
data/gpm-1.20.7/src/daemon/check_uniqueness.c:37: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((fp = fopen(GPM_NODE_PID, "r")) != NULL) {
data/gpm-1.20.7/src/daemon/check_uniqueness.c:46: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(GPM_NODE_PID,"w")) != NULL) {
data/gpm-1.20.7/src/daemon/cmdline.c:44:47:  [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).
         case 'a': (which_mouse->opt_accel) = atoi(optarg);             break;
data/gpm-1.20.7/src/daemon/cmdline.c:47:38:  [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).
                     opt_age_limit = atoi(optarg);       break;
data/gpm-1.20.7/src/daemon/cmdline.c:48:46:  [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).
         case 'b': (which_mouse->opt_baud) = atoi(optarg);              break;
data/gpm-1.20.7/src/daemon/cmdline.c:50:47:  [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).
         case 'd': (which_mouse->opt_delta) = atoi(optarg);             break;
data/gpm-1.20.7/src/daemon/cmdline.c:52:54:  [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).
         case 'g': (which_mouse->opt_glidepoint_tap)=atoi(optarg);      break;
data/gpm-1.20.7/src/daemon/cmdline.c:54:44:  [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).
         case 'i': (which_mouse->opt_time)=atoi(optarg);                break;
data/gpm-1.20.7/src/daemon/cmdline.c:73:38:  [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).
            (which_mouse->opt_scale)=atoi(optarg);
data/gpm-1.20.7/src/daemon/cmdline.c:80:48:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         case 's': (which_mouse->opt_sample) = atoi(optarg);            break;
data/gpm-1.20.7/src/daemon/getmousedata.c:38:20:  [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 unsigned char data[32]; /* quite a big margin :) */
data/gpm-1.20.7/src/daemon/gpm.c:57:1:  [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 **mouse_argv[3]; /* 0 for default (unused) and two mice */
data/gpm-1.20.7/src/daemon/loadlut.c:62:12:  [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).
   if ((fd=open(option.consolename, O_WRONLY)) < 0) {
data/gpm-1.20.7/src/daemon/loadlut.c:71:15:  [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).
      if ((fd=open(option.consolename, O_WRONLY)) < 0) gpm_report(GPM_PR_OOPS,GPM_MESS_OPEN_CON);
data/gpm-1.20.7/src/daemon/old_main.c:57:20:  [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).
      else if( (fd=open((which_mouse->opt_dev),O_RDWR | O_NDELAY)) < 0)
data/gpm-1.20.7/src/daemon/old_main.c:177:36:  [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).
            if ((mouse_table[1].fd=open((mouse_table[1].opt_dev),O_RDWR))<0)
data/gpm-1.20.7/src/daemon/open_console.c:47:9:  [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(option.consolename, mode);
data/gpm-1.20.7/src/daemon/processconn.c:119: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(&tty[strlen(option.consolename) - 1], "%d", vc);
data/gpm-1.20.7/src/daemon/processspecial.c:82:12:  [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).
  consolef=fopen(option.consolename,"w");
data/gpm-1.20.7/src/daemon/processspecial.c:156:7:  [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).
      open(GPM_NULL_DEV,O_RDONLY); /* stdin  */
data/gpm-1.20.7/src/daemon/processspecial.c:157:7:  [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).
      open(option.consolename,O_WRONLY); /* stdout */
data/gpm-1.20.7/src/daemon/selection_copy.c:36: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[6*sizeof(short)];
data/gpm-1.20.7/src/daemon/startup.c:74:18:  [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).
      if((fifofd=open(GPM_NODE_FIFO, O_RDWR|O_NONBLOCK)) < 0)
data/gpm-1.20.7/src/daemon/wait_text.c:46:16:  [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).
   if ((*fdptr=open((which_mouse->opt_dev),O_RDWR))<0)
data/gpm-1.20.7/src/gpm2/include/gpm2-daemon.h:47:10:  [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).
   int (*open)(int fd);
data/gpm-1.20.7/src/gpm2/mice/mice_handler.c:57:18:  [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).
   int ps2test = open("/dev/psaux",O_RDWR);
data/gpm-1.20.7/src/gpm2/mice/ps2.c:102:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char data[3];
data/gpm-1.20.7/src/headers/daemon.h:73: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     proto[4];
data/gpm-1.20.7/src/headers/daemon.h:147: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.
extern char           **mouse_argv[3];    /* and two mice                  */
data/gpm-1.20.7/src/lib/libcurses.c:105:21:  [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.
    int c; unsigned char mdata[4];
data/gpm-1.20.7/src/lib/liblow.c:83: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.
unsigned char    _gpm_buf[6*sizeof(short)];
data/gpm-1.20.7/src/lib/liblow.c:271:10:  [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(tty, consolename, strlen(consolename)-1);
data/gpm-1.20.7/src/lib/liblow.c:272:10:  [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(&tty[strlen(consolename) - 1], "%i", flag);
data/gpm-1.20.7/src/lib/liblow.c:282: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).
         conn->vc=atoi(&tty[strlen(consolename)-1]);
data/gpm-1.20.7/src/lib/liblow.c:287:29:  [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).
         if ((gpm_consolefd=open(tty,O_WRONLY)) < 0) {
data/gpm-1.20.7/src/lib/liblow.c:350:23:  [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).
          if ((gpm_fd=open(GPM_NODE_DEV,O_RDWR))==-1) {
data/gpm-1.20.7/src/lib/liblow.c:569:25:  [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.
        int c; unsigned char mdata[4];
data/gpm-1.20.7/src/lib/libxtra.c:51: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.
static char gpm_ver_s[16];
data/gpm-1.20.7/src/lib/libxtra.c:56:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char line[128];
data/gpm-1.20.7/src/mice.c:243: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.
   (void) memcpy (&thisevent, data, sizeof (struct input_event));
data/gpm-1.20.7/src/mice.c:362:11:  [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.
   signed char buffer[3];
data/gpm-1.20.7/src/mice.c:379:11:  [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.
   signed char buffer[5];
data/gpm-1.20.7/src/mice.c:451:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[4] = {0, 0, 0, 0};
data/gpm-1.20.7/src/mice.c:517: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.
  signed char buffer[3];
data/gpm-1.20.7/src/mice.c:538:11:  [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.
   signed char buffer[5];
data/gpm-1.20.7/src/mice.c:553:11:  [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.
   signed char buffer[4];
data/gpm-1.20.7/src/mice.c:739: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 magic[6] = { 0xe8, 0x03, 0xe6, 0xe6, 0xe6, 0xe9 };
data/gpm-1.20.7/src/mice.c:753:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      unsigned char rep[3] = { 0, 0, 0 };
data/gpm-1.20.7/src/mice.c:827:1:  [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 upmbuf[25]; /* needed only for macro buttons of ultrapad */
data/gpm-1.20.7/src/mice.c:832:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char name[15];       
data/gpm-1.20.7/src/mice.c:833:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char magic[3];
data/gpm-1.20.7/src/mice.c:1627:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   int sample; char code[2];
data/gpm-1.20.7/src/mice.c:1819:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buffer[BUFFER_SIZE], *p;
data/gpm-1.20.7/src/mice.c:1936: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 cmd[2], ret[512];
data/gpm-1.20.7/src/mice.c:2151:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buffer[255];
data/gpm-1.20.7/src/mice.c:2152:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char config[5];
data/gpm-1.20.7/src/mice.c:2251:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char s[80];
data/gpm-1.20.7/src/mice.c:2283: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).
   f = fopen(GUNZE_CALIBRATION_FILE, "r");
data/gpm-1.20.7/src/mice.c:2311: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 s[80];
data/gpm-1.20.7/src/mice.c:2335: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(ELO_CALIBRATION_FILE, "r");
data/gpm-1.20.7/src/mice.c:2364:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char tablet_info[256];
data/gpm-1.20.7/src/prog/hltest.c:155:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char name[5];
data/gpm-1.20.7/src/prog/hltest.c:194:4:  [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(name,"%3i",((WinInfo *)which->clientdata)->number);
data/gpm-1.20.7/src/prog/hltest.c:208: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(dumpbuf,dumpbuf_clean,vcsize);
data/gpm-1.20.7/src/prog/hltest.c:241:4:  [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(strings[current]+strlen(strings[current]),"%i: ",window);
data/gpm-1.20.7/src/prog/hltest.c:397:1:  [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[32];
data/gpm-1.20.7/src/prog/hltest.c:402:4:  [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(msg,"bg"),back++;
data/gpm-1.20.7/src/prog/hltest.c:406:4:  [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(msg," down");
data/gpm-1.20.7/src/prog/hltest.c:411:4:  [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(msg," up");
data/gpm-1.20.7/src/prog/hltest.c:430:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char *s, t[4];
data/gpm-1.20.7/src/prog/hltest.c:431:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char devname[32]; /* very secure buffer ... */
data/gpm-1.20.7/src/prog/hltest.c:462:4:  [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(devname,"/dev/vcs%i",vc);
data/gpm-1.20.7/src/prog/hltest.c:463:17:  [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).
   if ((dev_vcs=open(devname,O_RDWR))<0) {
data/gpm-1.20.7/src/prog/hltest.c:465: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(devname,"/dev/vcc/%i",vc);
data/gpm-1.20.7/src/prog/hltest.c:466:20:  [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).
      if ((dev_vcs=open(devname,O_RDWR))<0) {
data/gpm-1.20.7/src/prog/hltest.c:531: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 s[32];
data/gpm-1.20.7/src/prog/hltest.c:535:4:  [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(s,"0x%x",c);
data/gpm-1.20.7/src/prog/hltest.c:537:6:  [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(s+strlen(s)," ('%c')",c);
data/gpm-1.20.7/src/prog/mev.c:118:11:  [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 buffer[64];
data/gpm-1.20.7/src/prog/mev.c:185: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(buffer, "drag-");
data/gpm-1.20.7/src/prog/mev.c:273:24:  [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).
      case 0: *where = atoi(arg); break;
data/gpm-1.20.7/src/prog/mev.c:274:25:  [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).
      case 1: *where |= atoi(arg); break;
data/gpm-1.20.7/src/prog/mev.c:275: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).
      case 2: *where &= ~atoi(arg); break;
data/gpm-1.20.7/src/prog/mev.c:366:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char *argv[20];
data/gpm-1.20.7/src/prog/mev.c:429:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char cmd[128];
data/gpm-1.20.7/src/prog/mouse-test.c:157:12:  [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).
   if ((fd=open(name,O_RDWR|O_NONBLOCK))==-1) {
data/gpm-1.20.7/src/prog/mouse-test.c:191:7:  [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(name,O_RDWR);
data/gpm-1.20.7/src/prog/mouse-test.c:293:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[BUFLEN];
data/gpm-1.20.7/src/prog/mouse-test.c:317: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 s[64];
data/gpm-1.20.7/src/prog/mouse-test.c:679: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 *tognames[3]={"both","dtr","rts"};
data/gpm-1.20.7/src/prog/mouse-test.c:680: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 *Xtognames[3]={"'ClearDTR' and 'ClearRTS'","'ClearDTR'","'ClearRTS'"}; 
data/gpm-1.20.7/src/prog/open_console.c:29:14:  [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).
   if ((fd = open(option.consolename, mode)) < 0)
data/gpm-1.20.7/src/report.c:152:30:  [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((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) {
data/gpm-1.20.7/src/report.c:166:30:  [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((console = fopen(GPM_SYS_CONSOLE,"a")) != NULL) {
data/gpm-1.20.7/src/report.c:173:30:  [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((console = fopen(option.consolename,"a")) != NULL) {
data/gpm-1.20.7/src/synaptics.c:2071: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 [80];
data/gpm-1.20.7/src/synaptics.c:2076: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 full_filename[100];
data/gpm-1.20.7/src/synaptics.c:2087:19:  [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 ( !(config = fopen (full_filename, "r")) ) {
data/gpm-1.20.7/src/synaptics.c:2247: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 bytes [3];
data/gpm-1.20.7/src/synaptics.c:2317: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 junk [15];
data/gpm-1.20.7/src/synaptics.c:2332: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 bytes [15];
data/gpm-1.20.7/src/synaptics.c:2334: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 (bytes, "%%C3B%02X5555", mode);
data/gpm-1.20.7/src/synaptics.c:2345: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 bytes [5];
data/gpm-1.20.7/src/synaptics.c:2376: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 bytes [7];
data/gpm-1.20.7/src/synaptics.c:2413: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 bytes [8];
data/gpm-1.20.7/src/synaptics.c:2701: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 bytes [3];
data/gpm-1.20.7/src/synaptics.c:2740: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 bytes [3];
data/gpm-1.20.7/src/synaptics.c:2756: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 bytes [3];
data/gpm-1.20.7/src/twiddler.c:68:1:  [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 *twiddler_table[7][256];
data/gpm-1.20.7/src/twiddler.c:154:20:  [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).
   int consolenr = atoi(s); /* atoi never fails :) */
data/gpm-1.20.7/src/twiddler.c:177:10:  [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).
         open(GPM_NULL_DEV,O_RDONLY);
data/gpm-1.20.7/src/twiddler.c:178:10:  [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).
         open(option.consolename,O_WRONLY);
data/gpm-1.20.7/src/twiddler.c:400:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char buf[64];
data/gpm-1.20.7/src/twiddler.c:461:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char s[128], buf[64]; /* buf is for the string */
data/gpm-1.20.7/src/twiddler.c:462:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char mod[64], chord[64], *value;
data/gpm-1.20.7/src/twiddler.c:470: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 (!(f = fopen(TW_SYSTEM_FILE,"r"))) {
data/gpm-1.20.7/src/twiddler.c:528:18:  [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 ( (f=fopen(files[fileindex],"r")) ) break;
data/gpm-1.20.7/contrib/other/TPdetect.cc:19:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int b=read(fd,inbuffer,1);
data/gpm-1.20.7/contrib/other/TPdetect.cc:38:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    b= read(fd,inbuffer+a,n-a);
data/gpm-1.20.7/contrib/other/TPdetect.cc:85:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(fd,inbuffer+a,1);
data/gpm-1.20.7/src/daemon/find_mouse_by_name.c:35: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).
   int len = strlen(name);
data/gpm-1.20.7/src/daemon/get_data.c:36:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   while ((i=read(whence,&check,sizeof(int)))==4 && check!=GPM_MAGIC)
data/gpm-1.20.7/src/daemon/get_data.c:46:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if ((i=read(whence, where, sizeof(Gpm_Connect)))!=sizeof(Gpm_Connect)) {
data/gpm-1.20.7/src/daemon/getmousedata.c:45:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if (read(fd, data, howmany)!=howmany) {
data/gpm-1.20.7/src/daemon/getmousedata.c:73:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         j = read(fd,edata-i,i); /* edata is pointer just after data */
data/gpm-1.20.7/src/daemon/loadlut.c:65: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).
      if((option.consolename=malloc(strlen(GPM_SYS_CONSOLE)+1)) == NULL)
data/gpm-1.20.7/src/daemon/old_main.c:93:35:  [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=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL);
data/gpm-1.20.7/src/daemon/processconn.c:114: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).
          malloc(strlen(option.consolename) + Gpm_cnt_digits(vc) +
data/gpm-1.20.7/src/daemon/processconn.c:118:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(tty, option.consolename, strlen(option.consolename) - 1);
data/gpm-1.20.7/src/daemon/processconn.c:118: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).
      strncpy(tty, option.consolename, strlen(option.consolename) - 1);
data/gpm-1.20.7/src/daemon/processconn.c:119: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).
      sprintf(&tty[strlen(option.consolename) - 1], "%d", vc);
data/gpm-1.20.7/src/daemon/startup.c:83: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).
      if (strlen(which_mouse->opt_sequence) <= 0)
data/gpm-1.20.7/src/gpm2/generic/read_packet.c:38:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if(read(fd,&packet,len) == -1) {
data/gpm-1.20.7/src/gpm2/mice/ps2.c:66:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(fd,&ibuf,1);
data/gpm-1.20.7/src/gpm2/mice/ps2.c:77:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(fd,&ibuf,1);
data/gpm-1.20.7/src/gpm2/mice/ps2.c:79:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(fd,&ibuf,1);
data/gpm-1.20.7/src/gpm2/mice/ps2.c:92:4:  [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 (30000);
data/gpm-1.20.7/src/gpm2/mice/ps2.c:108:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(fd,data,3);
data/gpm-1.20.7/src/lib/liblow.c:269: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((tty = malloc(strlen(consolename) + Gpm_cnt_digits(flag))) == NULL)
data/gpm-1.20.7/src/lib/liblow.c:271:35:  [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(tty, consolename, strlen(consolename)-1);
data/gpm-1.20.7/src/lib/liblow.c:272: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).
         sprintf(&tty[strlen(consolename) - 1], "%i", flag);
data/gpm-1.20.7/src/lib/liblow.c:282: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).
         conn->vc=atoi(&tty[strlen(consolename)-1]);
data/gpm-1.20.7/src/lib/liblow.c:321:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy (addr.sun_path, sock_name, sizeof (addr.sun_path));
data/gpm-1.20.7/src/lib/liblow.c:323: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).
                sizeof (addr.sun_family) + strlen (addr.sun_path))==-1) {
data/gpm-1.20.7/src/lib/liblow.c:332:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL);
data/gpm-1.20.7/src/lib/liblow.c:460:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ((count=read(gpm_fd,&magic,sizeof(int)))!=sizeof(int))
data/gpm-1.20.7/src/lib/liblow.c:473:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ((count=read(gpm_fd,event,sizeof(Gpm_Event)))!=sizeof(Gpm_Event))
data/gpm-1.20.7/src/lib/liblow.c:524:25:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (!gpm_flag) return getc(f);
data/gpm-1.20.7/src/lib/liblow.c:552:18:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
          return fgetc(f);
data/gpm-1.20.7/src/lib/liblow.c:584:20:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if ((c=fgetc(f))!=0x1b) return c;
data/gpm-1.20.7/src/lib/liblow.c:590:20:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if ((c=fgetc(f))!='[')
data/gpm-1.20.7/src/lib/liblow.c:597:20:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if ((c=fgetc(f))!='M')
data/gpm-1.20.7/src/lib/liblow.c:603:40:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            for (c=0;c<3;c++) mdata[c]=fgetc(f);
data/gpm-1.20.7/src/lib/liblow.c:615:17:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    else return fgetc(f);                        /* no mouse available */
data/gpm-1.20.7/src/lib/libxtra.c:69: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).
      gpm_ver_s[strlen(gpm_ver_s) - 1] = '\0';  /* cut the ',' */
data/gpm-1.20.7/src/mice.c:117: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).
         j = strlen(p->name);
data/gpm-1.20.7/src/mice.c:746:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      read( fd, &c, 1 );
data/gpm-1.20.7/src/mice.c:754:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      read( fd, rep, 1 );
data/gpm-1.20.7/src/mice.c:755:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      read( fd, rep+1, 1 );
data/gpm-1.20.7/src/mice.c:756:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      read( fd, rep+2, 1 );
data/gpm-1.20.7/src/mice.c:1619:4:  [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(100000);
data/gpm-1.20.7/src/mice.c:1653:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         case  1: if (read(fd,&c,1)==0) break;
data/gpm-1.20.7/src/mice.c:1765: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).
   write(fd, UD_RESETBAUD, strlen(UD_RESETBAUD));
data/gpm-1.20.7/src/mice.c:1766:4:  [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(250000);
data/gpm-1.20.7/src/mice.c:1768: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).
   write(fd, UD_RESET,     strlen(UD_RESET));
data/gpm-1.20.7/src/mice.c:1769:4:  [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(75000);
data/gpm-1.20.7/src/mice.c:1773:24:  [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).
   write(fd, UD_RESET, strlen(UD_RESET));
data/gpm-1.20.7/src/mice.c:1774:4:  [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(250000);
data/gpm-1.20.7/src/mice.c:1775: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).
   write(fd, UD_STOP, strlen(UD_STOP));
data/gpm-1.20.7/src/mice.c:1776:4:  [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(100000);
data/gpm-1.20.7/src/mice.c:1804: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).
   if (cmd) write(fd,cmd,strlen(cmd));
data/gpm-1.20.7/src/mice.c:1808:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      p+= read(fd,p,(sizeof(char)*buffer_len-1)-(p-buffer));
data/gpm-1.20.7/src/mice.c:1812: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).
   return ((strlen(buffer) >= (sizeof(char)*buffer_len-1))? !0 :0);
data/gpm-1.20.7/src/mice.c:1917:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(fd, &c, 1);
data/gpm-1.20.7/src/mice.c:1921:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(fd, &id, 1);
data/gpm-1.20.7/src/mice.c:1950:4:  [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(sleep);
data/gpm-1.20.7/src/mice.c:1953:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   rcnt = read(fd, ret, rnum);
data/gpm-1.20.7/src/mice.c:1956:4:  [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(sleep);
data/gpm-1.20.7/src/mice.c:2133:4:  [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(400000); /* wait */
data/gpm-1.20.7/src/mice.c:2171: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).
   write(fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE));
data/gpm-1.20.7/src/mice.c:2177: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).
      write(fd, SS_FIRMID, strlen(SS_FIRMID));
data/gpm-1.20.7/src/mice.c:2181:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         read(fd, buffer, 255); /* Read Firm-ID */
data/gpm-1.20.7/src/mice.c:2195:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
               read(fd,&config,1);
data/gpm-1.20.7/src/mice.c:2210:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if (!((err == -1) || (!err))) read(fd,buffer,sizeof(buffer));
data/gpm-1.20.7/src/mice.c:2212:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(fd,&config,5);
data/gpm-1.20.7/src/mice.c:2386:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   count = read(fd, tablet_info, 255);
data/gpm-1.20.7/src/prog/hltest.c:89:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   return read(dev_vcs,buf,vcsize);
data/gpm-1.20.7/src/prog/hltest.c:241: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).
   sprintf(strings[current]+strlen(strings[current]),"%i: ",window);
data/gpm-1.20.7/src/prog/hltest.c:242:4:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
   strncat(strings[current],msg,LEFTWID-2-strlen(strings[current]));
data/gpm-1.20.7/src/prog/hltest.c:242: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).
   strncat(strings[current],msg,LEFTWID-2-strlen(strings[current]));
data/gpm-1.20.7/src/prog/hltest.c:243:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   for (i=strlen(strings[current]);i<19;i++)
data/gpm-1.20.7/src/prog/hltest.c:537: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).
     sprintf(s+strlen(s)," ('%c')",c);
data/gpm-1.20.7/src/prog/mev.c:368: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).
   if (*cmd && cmd[strlen(cmd)-1]=='\n')
data/gpm-1.20.7/src/prog/mev.c:369: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).
      cmd[strlen(cmd)-1]='\0';
data/gpm-1.20.7/src/prog/mouse-test.c:190:4:  [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(100000);
data/gpm-1.20.7/src/prog/mouse-test.c:264:10:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         getchar();
data/gpm-1.20.7/src/prog/mouse-test.c:268:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         if (active) got+=read(fd,buff+got,readstep);
data/gpm-1.20.7/src/prog/mouse-test.c:269:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         else read(fd,buff,buflen);
data/gpm-1.20.7/src/prog/mouse-test.c:325: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).
         s[strlen(s)-1]='\0'; /* trim '\n' */
data/gpm-1.20.7/src/prog/mouse-test.c:382:13:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            getchar();
data/gpm-1.20.7/src/prog/mouse-test.c:402:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	         read(cur->fd,buf,80); /* flush */
data/gpm-1.20.7/src/prog/mouse-test.c:446:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   i=read(mousefd,buf,1);
data/gpm-1.20.7/src/prog/mouse-test.c:452:4:  [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(100000);
data/gpm-1.20.7/src/prog/mouse-test.c:472:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   read(mousefd,buf,BUFLEN); /* flush */
data/gpm-1.20.7/src/prog/mouse-test.c:586:17:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      putchar(i=getchar()); printf("\r\n");
data/gpm-1.20.7/src/prog/mouse-test.c:721:4:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   getchar();
data/gpm-1.20.7/src/synaptics.c:2267:3:  [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 (50000);
data/gpm-1.20.7/src/synaptics.c:2274:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read (fd, &junk, 1);
data/gpm-1.20.7/src/synaptics.c:2301:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read_count = read (fd, &bytes [num_read], count - num_read);
data/gpm-1.20.7/src/synaptics.c:2320:19:  [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).
  write (fd, cmd, strlen (cmd));
data/gpm-1.20.7/src/synaptics.c:2321: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).
  tp_serial_read (fd, junk, strlen (cmd));
data/gpm-1.20.7/src/synaptics.c:2323: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).
  junk [strlen (cmd)] = '\0';
data/gpm-1.20.7/src/synaptics.c:2512:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  read(fd, &b, 1);
data/gpm-1.20.7/src/synaptics.c:2533:3:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  read(fd, &ack, 1);
data/gpm-1.20.7/src/synaptics.c:2537:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read(fd, &ack, 1);
data/gpm-1.20.7/src/synaptics.c:2801:3:  [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 (50000);
data/gpm-1.20.7/src/synaptics.c:2804:5:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    read (fd, &status, 1);
data/gpm-1.20.7/src/synaptics.c:2871:3:  [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(750000);
data/gpm-1.20.7/src/tools.c:54: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).
      if((back = malloc(strlen(tmp) + sizeof(char)) ) != NULL)
data/gpm-1.20.7/src/twiddler.c:322: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).
   int len = strlen(mod);
data/gpm-1.20.7/src/twiddler.c:340:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(chord)!=4) return -1;
data/gpm-1.20.7/src/twiddler.c:434:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(ptr)==1) return ((char *)((unsigned long)*ptr & 0xFF));
data/gpm-1.20.7/src/twiddler.c:442: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).
      if (!strncasecmp(fptr->name,ptr,strlen(fptr->name))) {
data/gpm-1.20.7/src/twiddler.c:449:61:  [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).
         twiddler_active_funs[active_fun_nr].arg=strdup(ptr+strlen(fptr->name));
data/gpm-1.20.7/src/twiddler.c:481: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 (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0';
data/gpm-1.20.7/src/twiddler.c:481:38:  [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 (s[strlen(s)-1]=='\n') s[strlen(s)-1] = '\0';
data/gpm-1.20.7/src/twiddler.c:482: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(s[strlen(s)-1])) s[strlen(s)-1] = '\0';
data/gpm-1.20.7/src/twiddler.c:482: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).
         while (isspace(s[strlen(s)-1])) s[strlen(s)-1] = '\0';

ANALYSIS SUMMARY:

Hits = 293
Lines analyzed = 15116 in approximately 0.77 seconds (19638 lines/second)
Physical Source Lines of Code (SLOC) = 8944
Hits@level = [0] 158 [1] 111 [2] 121 [3]   5 [4]  55 [5]   1
Hits@level+ = [0+] 451 [1+] 293 [2+] 182 [3+]  61 [4+]  56 [5+]   1
Hits/KSLOC@level+ = [0+] 50.4249 [1+] 32.7594 [2+] 20.3488 [3+] 6.82021 [4+] 6.26118 [5+] 0.111807
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.