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/most-5.0.0a/src/keym.c
Examining data/most-5.0.0a/src/display.c
Examining data/most-5.0.0a/src/sysdep.c
Examining data/most-5.0.0a/src/jdmacros.h
Examining data/most-5.0.0a/src/keym.h
Examining data/most-5.0.0a/src/display.h
Examining data/most-5.0.0a/src/sysdep.h
Examining data/most-5.0.0a/src/most.c
Examining data/most-5.0.0a/src/w32conf.h
Examining data/most-5.0.0a/src/most.h
Examining data/most-5.0.0a/src/chkslang.c
Examining data/most-5.0.0a/src/mostconf.h
Examining data/most-5.0.0a/src/cmd.c
Examining data/most-5.0.0a/src/search.c
Examining data/most-5.0.0a/src/window.c
Examining data/most-5.0.0a/src/buffer.c
Examining data/most-5.0.0a/src/search.h
Examining data/most-5.0.0a/src/window.h
Examining data/most-5.0.0a/src/buffer.h
Examining data/most-5.0.0a/src/keyparse.c
Examining data/most-5.0.0a/src/main.c
Examining data/most-5.0.0a/src/edit.c
Examining data/most-5.0.0a/src/line.c
Examining data/most-5.0.0a/src/keyparse.h
Examining data/most-5.0.0a/src/help.c
Examining data/most-5.0.0a/src/edit.h
Examining data/most-5.0.0a/src/version.h
Examining data/most-5.0.0a/src/line.h
Examining data/most-5.0.0a/src/file.c
Examining data/most-5.0.0a/src/file.h

FINAL RESULTS:

data/most-5.0.0a/src/buffer.c:556: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(buf->file,file);
data/most-5.0.0a/src/edit.c:207:4:  [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(the_file, file);
data/most-5.0.0a/src/file.c:140:12:  [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.
	     fp = popen (cmdbuf, "r"); /* GLIBC doe not support "rb" */
data/most-5.0.0a/src/file.c:553:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf (msg, "%s failed to open.", file);
data/most-5.0.0a/src/file.c:556:2:  [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 (msgp, msg);
data/most-5.0.0a/src/file.c:599:14:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
   if (-1 == access(Most_Buf->file, 0))        /* does it exist? */
data/most-5.0.0a/src/file.c:607: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 (file, Most_Buf->file);
data/most-5.0.0a/src/file.c:622:14:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
   if (-1 == access(file, 0))        /* does it exist? */
data/most-5.0.0a/src/file.c:645:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(mbuf, "Next File (%d): ...%s", j, file + (len - max_len));
data/most-5.0.0a/src/file.c:647:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
   else	sprintf(mbuf, "Next File (%d): %s", j, file);
data/most-5.0.0a/src/file.c:713:11:  [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).
   (void) strcpy(dir,file);
data/most-5.0.0a/src/file.c:777: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(tmp_dir,Most_C_Dir);
data/most-5.0.0a/src/file.c:789: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(Most_C_Dir,tmp_dir);
data/most-5.0.0a/src/file.c:809:6:  [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(file,Most_C_Dir);
data/most-5.0.0a/src/file.c:818:2:  [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(path,name);
data/most-5.0.0a/src/file.c:837:2:  [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(Most_File_Ring[Most_Num_Files++],name);
data/most-5.0.0a/src/help.c:190: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(Most_Buf->file, buf_name);
data/most-5.0.0a/src/keym.c:207:13:  [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.
   if (1 != sscanf((char *) Most_Mini_Buf, MOST_INT_D_FMT, n))
data/most-5.0.0a/src/keym.c:321:6:  [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 (Most_Search_Str, buf);    /* no buffer overflow here */
data/most-5.0.0a/src/keyparse.c:168:2:  [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 (filebuf, file);
data/most-5.0.0a/src/most.c:133:2:  [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 (Most_Search_Str,++str);
data/most-5.0.0a/src/most.c:293:2:  [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, fmt, ap);
data/most-5.0.0a/src/most.c:514:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	     strcat(file, most_unix2vms(argv[i++]));
data/most-5.0.0a/src/most.c:518:5:  [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(Most_File_Ring[Most_Num_Files++], filename);
data/most-5.0.0a/src/most.c:523:22:  [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).
	if (Most_Num_Files) strcpy(file,Most_File_Ring[0]);
data/most-5.0.0a/src/most.h:65:23:  [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.
# define _pSLsnprintf snprintf
data/most-5.0.0a/src/search.c:89:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
   sprintf(string, "Regular expression error: %s", s);
data/most-5.0.0a/src/search.c:148: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((char *)savepattern, (char *)key);
data/most-5.0.0a/src/search.c:390:2:  [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(work, (char *) key);
data/most-5.0.0a/src/search.c:596:2:  [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(work, (char *) key);
data/most-5.0.0a/src/search.c:757:12:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		  (void) sprintf(string,"Search failed: %s",Most_Search_Str);
data/most-5.0.0a/src/sysdep.c:125: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(sstring, string); strcpy(svarname, varname);
data/most-5.0.0a/src/sysdep.c:125:29:  [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(sstring, string); strcpy(svarname, varname);
data/most-5.0.0a/src/sysdep.c:228:2:  [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(inputname, file);
data/most-5.0.0a/src/window.c:64: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 (Most_Mini_Buf,what);
data/most-5.0.0a/src/window.c:214: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 ((char *)rli->buf, what);
data/most-5.0.0a/src/window.c:724: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(new->status,Most_Win->status);
data/most-5.0.0a/src/window.c:801:27:  [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).
	if (tmp == Most_Top_Win) strcpy(w->status,Most_Win->status);
data/most-5.0.0a/src/window.c:968: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(Most_Win->status,w->status); /* share the same line */
data/most-5.0.0a/src/edit.c:248:27:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   if ((NULL == (editor = getenv("MOST_EDITOR")))
data/most-5.0.0a/src/edit.c:249:30:  [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.
       && (NULL == (editor = getenv("SLANG_EDITOR")))
data/most-5.0.0a/src/edit.c:250:30:  [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.
       && (NULL == (editor = getenv("EDITOR"))))
data/most-5.0.0a/src/file.c:844:4:  [3] (buffer) getwd:
  This does not protect against buffer overflows by itself, so use with
  caution (CWE-120, CWE-20). Use getcwd instead.
   getwd(dir);
data/most-5.0.0a/src/file.c:849:4:  [3] (buffer) getwd:
  This does not protect against buffer overflows by itself, so use with
  caution (CWE-120, CWE-20). Use getcwd instead.
   getwd(dir);
data/most-5.0.0a/src/help.c:204:23:  [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.
   most_do_help_file (getenv ("MOST_HELP"));
data/most-5.0.0a/src/keyparse.c:154:24:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   if (NULL == (file = getenv ("MOST_INITFILE")))
data/most-5.0.0a/src/keyparse.c:160:9:  [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.
	file = getenv ("HOME");
data/most-5.0.0a/src/most.c:437:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   switches = getenv ("MOST_PROMPT");
data/most-5.0.0a/src/most.c:440:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   switches = getenv("MOST_SWITCHES");
data/most-5.0.0a/src/sysdep.c:145:17:  [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((pidstr = getenv("EMACS_PID")) != NULL)
data/most-5.0.0a/src/buffer.h:25: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 file[MAX_PATHLEN];            /* filename */
data/most-5.0.0a/src/chkslang.c:35: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 v_string[16];
data/most-5.0.0a/src/chkslang.c:41: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 (v_string, "%u.%u.%u", a, b, c);
data/most-5.0.0a/src/edit.c:197: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 the_file[MAX_PATHLEN], *strp;
data/most-5.0.0a/src/edit.c:231: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[2*MAX_PATHLEN + 30];
data/most-5.0.0a/src/file.c:58: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 *Most_File_Ring[MOST_MAX_FILES];
data/most-5.0.0a/src/file.c:59: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 Most_C_Dir[MAX_PATHLEN];                 /* current working dir */
data/most-5.0.0a/src/file.c:80: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[6], cmdbuf[2*MAX_PATHLEN];
data/most-5.0.0a/src/file.c:94: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).
	return (open(file,mode));
data/most-5.0.0a/src/file.c:96: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(file, O_RDONLY);
data/most-5.0.0a/src/file.c:154: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).
   return (open(file,mode));
data/most-5.0.0a/src/file.c:269:2:  [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 (Most_Buf->file, "*stdin*");
data/most-5.0.0a/src/file.c:281: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(file,O_RDONLY,"ctx=rec","mbf=8","mbc=16","rop=RAH","shr=upi,get,put");
data/most-5.0.0a/src/file.c:544: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 msg[MAX_PATHLEN+20], *msgp;
data/most-5.0.0a/src/file.c:596: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 file[MAX_PATHLEN];
data/most-5.0.0a/src/file.c:652: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 mbuf[256], *curr_file;
data/most-5.0.0a/src/file.c:768: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 tmp_dir[MAX_PATHLEN];
data/most-5.0.0a/src/file.c:797: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 path[MAX_PATHLEN], file[MAX_PATHLEN], *name;
data/most-5.0.0a/src/file.h:39: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 *Most_File_Ring[MOST_MAX_FILES];
data/most-5.0.0a/src/file.h:41: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 Most_C_Dir[MAX_PATHLEN];
data/most-5.0.0a/src/help.c:179:20:  [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 (NULL != (fp = fopen  (helpfile, "r")))
data/most-5.0.0a/src/jdmacros.h:34:21:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#   define SLMEMCPY memcpy
data/most-5.0.0a/src/keym.c:314: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[MOST_SEARCH_BUF_LEN];
data/most-5.0.0a/src/keym.c:498: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 esc[3], gold[5], dig[2];
data/most-5.0.0a/src/keym.c:685: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 num[15], ch;
data/most-5.0.0a/src/keyparse.c:110:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[512];
data/most-5.0.0a/src/keyparse.c:113:22:  [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 (NULL == (fp = fopen (file, "r"))) 
data/most-5.0.0a/src/keyparse.c:139: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 filebuf[MAX_PATHLEN];
data/most-5.0.0a/src/keyparse.c:173:2:  [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 (file + len, "/.mostrc");
data/most-5.0.0a/src/keyparse.c:271: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 *Ansi_Color_Map[9] =
data/most-5.0.0a/src/line.c:71: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 (s, "%02X", ch);
data/most-5.0.0a/src/line.c:110: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[256];
data/most-5.0.0a/src/line.c:117: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 (buf, "0x%08lX: ", (unsigned long) Most_C_Offset);
data/most-5.0.0a/src/line.c:216:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[16];
data/most-5.0.0a/src/line.c:351: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 (buf, "<%02X>", (unsigned int) ch);
data/most-5.0.0a/src/line.c:360: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 (buf, "^%c", ch);
data/most-5.0.0a/src/most.c:127: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 numstr [256];
data/most-5.0.0a/src/most.c:305: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[4096 * 4];
data/most-5.0.0a/src/most.c:312: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).
	fp = fopen(file, "r");
data/most-5.0.0a/src/most.c:423: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 file[MAX_PATHLEN], *switches;
data/most-5.0.0a/src/most.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 filename[256];
data/most-5.0.0a/src/search.c:40: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 Most_Search_Str[256];
data/most-5.0.0a/src/search.c:68:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static unsigned char regbuf[sizeof(Most_Search_Str) * 3];
data/most-5.0.0a/src/search.c:78:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char		savepattern[sizeof(Most_Search_Str)];
data/most-5.0.0a/src/search.c:86: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	string[256];
data/most-5.0.0a/src/search.c:104: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 UpCaseKey[sizeof(savepattern)];
data/most-5.0.0a/src/search.c:384: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 ch, char1, work[256];
data/most-5.0.0a/src/search.c:590: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 ch, char1, work[256];
data/most-5.0.0a/src/search.c:688: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 string[300];
data/most-5.0.0a/src/search.h:28: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 Most_Search_Str[MOST_SEARCH_BUF_LEN];
data/most-5.0.0a/src/sysdep.c:116: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 sstring[200], svarname[200];
data/most-5.0.0a/src/sysdep.c:166: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 str[80];
data/most-5.0.0a/src/sysdep.c:194: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(str,"Unable to spawn subprocess. Error = %X", status);
data/most-5.0.0a/src/sysdep.c:215: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 inputname[MAX_PATHLEN] = "";
data/most-5.0.0a/src/sysdep.c:238:2:  [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(expanded_file, result.dsc$a_pointer, result.dsc$w_length);
data/most-5.0.0a/src/sysdep.c:577: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 vms_name[MAX_PATHLEN];
data/most-5.0.0a/src/window.c:56: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 Most_Mini_Buf[256];
data/most-5.0.0a/src/window.c:598: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 info[256];
data/most-5.0.0a/src/window.c:599: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[32];
data/most-5.0.0a/src/window.c:627: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 (info, "(" MOST_INT_D_FMT ",%d) " MOST_INT_D_FMT "%%",
data/most-5.0.0a/src/window.c:637: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 (buf + 2, " MOST: ");
data/most-5.0.0a/src/window.h:55: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 Most_Mini_Buf[MOST_MINI_BUF_LEN];
data/most-5.0.0a/src/edit.c:57:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (NULL == (efile = SLmalloc (5 + 2*strlen(file))))
data/most-5.0.0a/src/edit.c:214: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).
   file_desc.dsc$w_length = strlen(the_file);
data/most-5.0.0a/src/file.c:100:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if (6 == read(fd, buf, 6))
data/most-5.0.0a/src/file.c:450:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	     i = read (fd, (char *) pos, recsz);
data/most-5.0.0a/src/file.c:452:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	     i = read (fd, (char *) pos, dsize - n);
data/most-5.0.0a/src/file.c:554:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	n = strlen (msg);
data/most-5.0.0a/src/file.c:641:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len = strlen (file);
data/most-5.0.0a/src/file.c:714: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).
   n = strlen(file) - 1;
data/most-5.0.0a/src/file.c:729: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).
   n = strlen(filed) - 1;
data/most-5.0.0a/src/file.c:757:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	n = strlen(path);
data/most-5.0.0a/src/file.c:782:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	n = strlen(Most_C_Dir);
data/most-5.0.0a/src/file.c:823: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).
   imax = strlen (name);
data/most-5.0.0a/src/file.c:836: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).
	Most_File_Ring[Most_Num_Files] = (char*) MOSTMALLOC(strlen(name) + 1);
data/most-5.0.0a/src/file.c:856:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	i = strlen(dir);
data/most-5.0.0a/src/keyparse.c:164: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).
	len = strlen (file);
data/most-5.0.0a/src/most.c:480:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy (file, argv[i], sizeof(file));
data/most-5.0.0a/src/most.c:513:30:  [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.
	     if (argv[i][0] == '.') strcpy(file,"*"); else *file = 0;
data/most-5.0.0a/src/most.c:517:57:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		  Most_File_Ring[Most_Num_Files] = (char*) MOSTMALLOC(strlen(filename) + 1);
data/most-5.0.0a/src/search.c:121: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((char *)key) >= sizeof(savepattern) )
data/most-5.0.0a/src/search.c:228: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).
   length = strlen((char *)src) + 1;	/* len of line plus terminator */
data/most-5.0.0a/src/search.c:391: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).
	key_len = strlen((char *) key);
data/most-5.0.0a/src/search.c:597: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).
	key_len = strlen((char *) key);
data/most-5.0.0a/src/search.c:698: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_len = strlen (Most_Search_Str);
data/most-5.0.0a/src/sysdep.c:119: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).
     {strlen (string), DSC$K_DTYPE_T, DSC$K_CLASS_S, sstring};
data/most-5.0.0a/src/sysdep.c:121: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).
     {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, svarname};
data/most-5.0.0a/src/sysdep.c:133: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).
     {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, varname};
data/most-5.0.0a/src/sysdep.c:229: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).
	len = strlen(inputname);
data/most-5.0.0a/src/sysdep.c:594: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).
   i = strlen(file) - 1;
data/most-5.0.0a/src/window.c:268:31:  [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).
	SLrline_set_point (Most_RLI, strlen (stuff));
data/most-5.0.0a/src/window.c:276:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(what, (char *) buf, buflen);
data/most-5.0.0a/src/window.c:639: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).
   num_chars = strlen (buf);
data/most-5.0.0a/src/window.c:647:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   info_len = strlen (info);
data/most-5.0.0a/src/window.c:658:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len = strlen (file);

ANALYSIS SUMMARY:

Hits = 145
Lines analyzed = 8014 in approximately 0.18 seconds (44279 lines/second)
Physical Source Lines of Code (SLOC) = 5944
Hits@level = [0]  27 [1]  33 [2]  62 [3]  11 [4]  39 [5]   0
Hits@level+ = [0+] 172 [1+] 145 [2+] 112 [3+]  50 [4+]  39 [5+]   0
Hits/KSLOC@level+ = [0+] 28.9367 [1+] 24.3943 [2+] 18.8425 [3+] 8.41184 [4+] 6.56124 [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.