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/spectemu-0.94a/akey.h
Examining data/spectemu-0.94a/ax.c
Examining data/spectemu-0.94a/ax.h
Examining data/spectemu-0.94a/spmain.h
Examining data/spectemu-0.94a/snapshot.c
Examining data/spectemu-0.94a/snapshot.h
Examining data/spectemu-0.94a/spmain.c
Examining data/spectemu-0.94a/spkey.c
Examining data/spectemu-0.94a/spkey.h
Examining data/spectemu-0.94a/spkey_p.h
Examining data/spectemu-0.94a/spscr.c
Examining data/spectemu-0.94a/spscr.h
Examining data/spectemu-0.94a/spscr_p.h
Examining data/spectemu-0.94a/spsound.c
Examining data/spectemu-0.94a/spsound.h
Examining data/spectemu-0.94a/sptape.c
Examining data/spectemu-0.94a/sptape.h
Examining data/spectemu-0.94a/vgakey.c
Examining data/spectemu-0.94a/vgascr.c
Examining data/spectemu-0.94a/z80.c
Examining data/spectemu-0.94a/vgaspect.c
Examining data/spectemu-0.94a/xkey.c
Examining data/spectemu-0.94a/xscr.c
Examining data/spectemu-0.94a/z80.h
Examining data/spectemu-0.94a/xscr.h
Examining data/spectemu-0.94a/xspect.c
Examining data/spectemu-0.94a/compr.h
Examining data/spectemu-0.94a/spver.h
Examining data/spectemu-0.94a/z80_op2.c
Examining data/spectemu-0.94a/z80_op1.c
Examining data/spectemu-0.94a/compr.c
Examining data/spectemu-0.94a/z80_type.h
Examining data/spectemu-0.94a/spperif.h
Examining data/spectemu-0.94a/z80_def.h
Examining data/spectemu-0.94a/z80_step.c
Examining data/spectemu-0.94a/spect.c
Examining data/spectemu-0.94a/z80optab.h
Examining data/spectemu-0.94a/z80optab.c
Examining data/spectemu-0.94a/z80_op3.c
Examining data/spectemu-0.94a/z80_op4.c
Examining data/spectemu-0.94a/z80_ari.h
Examining data/spectemu-0.94a/z80_op5.c
Examining data/spectemu-0.94a/z80_op1.h
Examining data/spectemu-0.94a/z80_op2.h
Examining data/spectemu-0.94a/z80_op3.h
Examining data/spectemu-0.94a/z80_op4.h
Examining data/spectemu-0.94a/z80_op5.h
Examining data/spectemu-0.94a/z80_op1x.c
Examining data/spectemu-0.94a/z80_op6.c
Examining data/spectemu-0.94a/z80_op3x.c
Examining data/spectemu-0.94a/z80_op4x.c
Examining data/spectemu-0.94a/z80_op2x.c
Examining data/spectemu-0.94a/xkey.h
Examining data/spectemu-0.94a/z80_op6.h
Examining data/spectemu-0.94a/vgascr.h
Examining data/spectemu-0.94a/misc.c
Examining data/spectemu-0.94a/acconfig.h
Examining data/spectemu-0.94a/spconf.h
Examining data/spectemu-0.94a/tapefile.c
Examining data/spectemu-0.94a/tapefile.h
Examining data/spectemu-0.94a/interf.c
Examining data/spectemu-0.94a/interf.h
Examining data/spectemu-0.94a/misc.h
Examining data/spectemu-0.94a/tapeout.c
Examining data/spectemu-0.94a/tapef_p.h
Examining data/spectemu-0.94a/utils/filt.c
Examining data/spectemu-0.94a/utils/spconv/spconv.c
Examining data/spectemu-0.94a/utils/spconv/spconv.h
Examining data/spectemu-0.94a/utils/spload.cc
Examining data/spectemu-0.94a/utils/spt2tap.c
Examining data/spectemu-0.94a/utils/tap2spt.c
Examining data/spectemu-0.94a/utils/taplist.c
Examining data/spectemu-0.94a/utils/tzxlist.c
Examining data/spectemu-0.94a/utils/recs.c
Examining data/spectemu-0.94a/bin_to_c.c
Examining data/spectemu-0.94a/xdispkb.c
Examining data/spectemu-0.94a/xutils.c
Examining data/spectemu-0.94a/spconf_p.h
Examining data/spectemu-0.94a/sp_def.h
Examining data/spectemu-0.94a/sptiming.h
Examining data/spectemu-0.94a/keynames.c
Examining data/spectemu-0.94a/xdispkb.h
Examining data/spectemu-0.94a/sp_to_s.c
Examining data/spectemu-0.94a/spconf.c
Examining data/spectemu-0.94a/sptiming.c
Examining data/spectemu-0.94a/spperif.c

FINAL RESULTS:

data/spectemu-0.94a/bin_to_c.c:93:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(outputfile, outprefix);
data/spectemu-0.94a/bin_to_c.c:94:3:  [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(outputfile, EXTENSION);
data/spectemu-0.94a/misc.c:117:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(ostr, nstr);
data/spectemu-0.94a/snapshot.c:605:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Could not open snapshot file `%s', %s",
data/spectemu-0.94a/snapshot.c:634:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(msgbuf, "Saved snapshot to file %s", filenamebuf);
data/spectemu-0.94a/snapshot.c:678:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Could not open snapshot file `%s', %s",
data/spectemu-0.94a/spconf.c:263:14:  [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.
  if(!atcol) fprintf(stderr, STTAB);
data/spectemu-0.94a/spconf.c:330: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(optionstr, spcf_options[i].enums[j]);
data/spectemu-0.94a/spkey.c:883:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "%s emulator", sp_paused ? "Paused" : "Unpaused");
data/spectemu-0.94a/spkey.c:931:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "sound %s", sound_on ? "on" : "off");
data/spectemu-0.94a/spkey.c:961:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Quick load %s", sp_quick_load ? "on" : "off");
data/spectemu-0.94a/spkey.c:974:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Private colormap %s", privatemap ? "on" : "off");
data/spectemu-0.94a/spmain.c:166:3:  [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(filenamebuf, GLOBALCFG);
data/spectemu-0.94a/spmain.c:172:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, 
data/spectemu-0.94a/spmain.c:180:5:  [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(filenamebuf, LOCALCFG);
data/spectemu-0.94a/spmain.c:186:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(msgbuf, "Note: Failed to create '%s': %s", filenamebuf, 
data/spectemu-0.94a/spmain.c:194:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(msgbuf, "Created '%s'", filenamebuf);
data/spectemu-0.94a/spmain.c:214:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Loading snapshot '%s'", spcf_init_snapshot);
data/spectemu-0.94a/spmain.c:221:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Loading tape '%s'", spcf_init_tapefile);
data/spectemu-0.94a/spmain.c:231:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(msgbuf, 
data/spectemu-0.94a/spsound.c:133:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(msgbuf, "Could not open sound device '%s': %s", 
data/spectemu-0.94a/spsound.c:148:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Warning: fcntl failed on sound device: %s", 
data/spectemu-0.94a/spsound.c:183:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(msgbuf, "Error writing sound device: %s", strerror(errno));
data/spectemu-0.94a/spsound.c:226:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(msgbuf, "ioctl(SOUND_PCM_WRITE_SYNC, 0) failed: %s", 
data/spectemu-0.94a/spsound.c:261:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(msgbuf, "ioctl(SNDCTL_DSP_SETFRAGMENT, %i) failed: %s", 
data/spectemu-0.94a/spsound.c:271:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "ioctl(SOUND_PCM_WRITE_BITS, %i) failed: %s",
data/spectemu-0.94a/spsound.c:280:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "ioctl(SOUND_PCM_WRITE_CHANNELS, %i) failed: %s",
data/spectemu-0.94a/spsound.c:289:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "ioctl(SOUND_PCM_WRITE_RATE, %i) failed: %s", 
data/spectemu-0.94a/spsound.c:297:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "ioctl(SOUND_PCM_WRITE_SYNC, 0) failed: %s", 
data/spectemu-0.94a/spsound.c:393:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(msgbuf, "Could not set audio information: %s", 
data/spectemu-0.94a/sptape.c:416:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(msgbuf, "  %s: WAITING %c", 
data/spectemu-0.94a/sptape.c:424:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	  sprintf(msgbuf, "  %s: LEADER", tapename);
data/spectemu-0.94a/sptape.c:444:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(msgbuf, "  %s: DATA", tapename);
data/spectemu-0.94a/sptape.c:459:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(msgbuf, "%s: %03d", tapename, rec_segment);
data/spectemu-0.94a/sptape.c:461:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	  sprintf(msgbuf+strlen(msgbuf),
data/spectemu-0.94a/sptape.c:470:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(msgbuf+strlen(msgbuf),
data/spectemu-0.94a/sptape.c:514:6:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	    sprintf(msgbuf, "  %s: DATA %i kB", 
data/spectemu-0.94a/sptape.c:635:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, " * Stopped recording tape `%s' * ", tapename);
data/spectemu-0.94a/sptape.c:659:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Could not open tape file `%s', %s",
data/spectemu-0.94a/sptape.c:669:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(msgbuf, 
data/spectemu-0.94a/tapefile.c:971:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(seg_desc, "Could not open `%s': %s", name, strerror(errno));
data/spectemu-0.94a/utils/spconv/spconv.c:89: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(my_directory,argv[0]);
data/spectemu-0.94a/utils/spconv/spconv.c:166:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(outfile,argv[1]); /* copy prefix    */
data/spectemu-0.94a/utils/spconv/spconv.c:171:3:  [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(outfile,argv[2]); /* append suffix  */
data/spectemu-0.94a/utils/spconv/spconv.c:175:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(outfile,argv[2]);
data/spectemu-0.94a/utils/spload.cc:409:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(datfilename, "%s.%s", tapefilename, SPT_EXT);
data/spectemu-0.94a/utils/spload.cc:473:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(datfilename, "%s.%03i", tapefilename, segc);
data/spectemu-0.94a/utils/spt2tap.c:49:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(filename, argv[1]);
data/spectemu-0.94a/utils/spt2tap.c:58:16:  [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(argc < 3) strcpy(filename, argv[1]);
data/spectemu-0.94a/utils/spt2tap.c:59:8:  [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).
  else strcpy(filename, argv[2]);
data/spectemu-0.94a/utils/spt2tap.c:84:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(filename, "%s.%03i", argv[1], line);
data/spectemu-0.94a/utils/tap2spt.c:21:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(filename, argv[1]);
data/spectemu-0.94a/utils/tap2spt.c:32:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
  strcpy(filename, argv[1]);
data/spectemu-0.94a/utils/tap2spt.c:50:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(filename, "%s.%03i", argv[1], i);
data/spectemu-0.94a/xscr.c:677:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Warning: shmget failed: %s", strerror(errno));
data/spectemu-0.94a/xscr.c:686:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "Warning: shmat failed: %s", strerror(errno));
data/spectemu-0.94a/xscr.c:712:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(msgbuf, "shmctl failed: %s", strerror(errno));
data/spectemu-0.94a/ax.c:459:21:  [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((environment = getenv("XENVIRONMENT")) != NULL) 
data/spectemu-0.94a/snapshot.c:641:8:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
    if(tmpnam(quick_snap_file) == NULL) {
data/spectemu-0.94a/spmain.c:170:13:  [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.
  homedir = getenv("HOME");
data/spectemu-0.94a/z80.c:62:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand((unsigned int) time(NULL));
data/spectemu-0.94a/ax.c:101: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 prog_name[MAX_PROG_NAME_LEN + 1];
data/spectemu-0.94a/ax.c:102: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 class_name[MAX_CLASS_NAME_LEN + 1];
data/spectemu-0.94a/ax.c:146:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char pnameres[MAX_PRES_LEN];
data/spectemu-0.94a/ax.c:152:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char pclassres[MAX_PRES_LEN];
data/spectemu-0.94a/ax.c:270:28:  [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).
    defres->border_width = atoi(value.addr);
data/spectemu-0.94a/ax.c:377:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[MAX_FILENAME_LEN];
data/spectemu-0.94a/bin_to_c.c:96:9:  [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).
  ifp = fopen(inputfile, "rb");
data/spectemu-0.94a/bin_to_c.c:103:9:  [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).
  ofp = fopen(outputfile, "wt");
data/spectemu-0.94a/interf.c:29: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 filenamebuf[MAXFILENAME];
data/spectemu-0.94a/interf.c:30: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 msgbuf[MAXMSGLEN];
data/spectemu-0.94a/interf.c:51:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char buf[MAXFILENAME];
data/spectemu-0.94a/keynames.c:23: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.
const char *spcf_keynames_ascii[95] = {
data/spectemu-0.94a/keynames.c:121: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.
const char *spcf_keynames_misc[256] = {
data/spectemu-0.94a/misc.c:80:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fp = fopen(filename, "rb");
data/spectemu-0.94a/snapshot.c: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.
static char quick_snap_file[MAXFILENAME];
data/spectemu-0.94a/snapshot.c:603:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  snsh = fopen(name, "wb");
data/spectemu-0.94a/snapshot.c:676:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  snsh = fopen(filenamebuf, "rb");
data/spectemu-0.94a/sp_to_s.c:400:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char buf[1024];
data/spectemu-0.94a/spconf.c:107:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char line[MAXLINELEN];
data/spectemu-0.94a/spconf.c:284: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 optionstr[128];
data/spectemu-0.94a/spconf.c:315:7:  [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(optionstr, "[-no]");
data/spectemu-0.94a/spconf.c:322: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(optionstr, " NUM");
data/spectemu-0.94a/spconf.c:328: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(optionstr, " <");
data/spectemu-0.94a/spconf.c:339: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(optionstr, " NAME");
data/spectemu-0.94a/spconf.c:372:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char compa[MAXATTRLEN];
data/spectemu-0.94a/spconf.c:485:9:  [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.
  cp = (char **) spcf_options[ix].argvalp;
data/spectemu-0.94a/spconf.c:572: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 spkeyname[MAXSPKEYNAME+1];
data/spectemu-0.94a/spconf.c:706: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).
  conffp = fopen(conffile, "rt");
data/spectemu-0.94a/spkey.c:909:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(msgbuf, "showframe: %i", showframe);
data/spectemu-0.94a/spkey.c:914:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(msgbuf, "showframe: %i", showframe);
data/spectemu-0.94a/spkey.c:919:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(msgbuf, "msgbuf, bufframes: %i", bufframes);
data/spectemu-0.94a/spkey.c:925:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(msgbuf, "bufframes: %i", bufframes);
data/spectemu-0.94a/spmain.c:184: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).
      fp = fopen(filenamebuf, "wt");
data/spectemu-0.94a/spperif.c:38: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 SPNM(colors)[16];
data/spectemu-0.94a/spperif.c:49: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.
signed char SPNM(tape_sound)[TMNUM];
data/spectemu-0.94a/spperif.c:77:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fp = fopen(ROM_IMAGE, "rb");
data/spectemu-0.94a/spsound.c:126: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).
  snd = open(sound_dev_name, openflags | O_NONBLOCK);
data/spectemu-0.94a/sptape.c:44: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 tapename[MAXFILENAME];
data/spectemu-0.94a/sptape.c:95:2:  [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(me, "%4i: ", currseg);
data/spectemu-0.94a/sptape.c:98: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(me, "%5li bytes, ", len);
data/spectemu-0.94a/sptape.c:109: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(me, "      ");
data/spectemu-0.94a/sptape.c:122:2:  [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(msgbuf, "%4i:", currseg);
data/spectemu-0.94a/sptape.c:317:19:  [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.
      if(ingroup) sprintf(msgbuf, "%4i: ", currseg);
data/spectemu-0.94a/sptape.c:318:19:  [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.
      else        sprintf(msgbuf, "      ");
data/spectemu-0.94a/sptape.c:319: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(msgbuf+strlen(msgbuf), "%3ik", datak);
data/spectemu-0.94a/sptape.c:455: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 filename[11];
data/spectemu-0.94a/sptape.c:657: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).
  tapefp = fopen(tapename, "ab");
data/spectemu-0.94a/tapefile.c:38: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 seg_desc[DESC_LEN];
data/spectemu-0.94a/tapefile.c:227: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(seg_desc, "Premature end of segment");
data/spectemu-0.94a/tapefile.c:242:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "End of Tape");
data/spectemu-0.94a/tapefile.c:292: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(seg_desc, "End of Tape");
data/spectemu-0.94a/tapefile.c:365:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Premature end of segment");
data/spectemu-0.94a/tapefile.c:375: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(seg_desc, "Data");
data/spectemu-0.94a/tapefile.c:406:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Turbo Data");
data/spectemu-0.94a/tapefile.c:420:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Pure Tone");
data/spectemu-0.94a/tapefile.c:434:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Pulse Sequence");
data/spectemu-0.94a/tapefile.c:441:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Pure Data");
data/spectemu-0.94a/tapefile.c:455:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Direct Recording");
data/spectemu-0.94a/tapefile.c:475: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(seg_desc, "Stop the Tape Mark");
data/spectemu-0.94a/tapefile.c:481: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(seg_desc, "Pause for %i.%03is", 
data/spectemu-0.94a/tapefile.c:504: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(seg_desc, "Begin Group: ");
data/spectemu-0.94a/tapefile.c:512:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "End Group");
data/spectemu-0.94a/tapefile.c:520: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(seg_desc, "Infinite loop");
data/spectemu-0.94a/tapefile.c:527: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(seg_desc, "Jump to %i", segi+offs);
data/spectemu-0.94a/tapefile.c:534:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Loop %i times", loopctr);
data/spectemu-0.94a/tapefile.c:546: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(seg_desc, "Loop to: %i", loopbeg);
data/spectemu-0.94a/tapefile.c:548: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.
    else sprintf(seg_desc, "Loop End");
data/spectemu-0.94a/tapefile.c:567: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(seg_desc, "Call to %i", segi+offset);
data/spectemu-0.94a/tapefile.c:573: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(seg_desc, "Call Sequence End");
data/spectemu-0.94a/tapefile.c:580:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Return");
data/spectemu-0.94a/tapefile.c:585:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Selection (Not yet supported)");
data/spectemu-0.94a/tapefile.c:592: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(seg_desc, "Stop the Tape in 48k Mode (Stopped)");
data/spectemu-0.94a/tapefile.c:597: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(seg_desc, "Stop the Tape in 48k Mode (Not Stopped)");
data/spectemu-0.94a/tapefile.c:644:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Hardware Information (Not yet supported)");
data/spectemu-0.94a/tapefile.c:650:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Emulation Information (Not yet supported)");
data/spectemu-0.94a/tapefile.c:656:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Custom Information (Not yet supported)");
data/spectemu-0.94a/tapefile.c:662:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Snapshot (Not yet supported)");
data/spectemu-0.94a/tapefile.c:668:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Tapefile Concatenation Point");
data/spectemu-0.94a/tapefile.c:675:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Unknown TZX block (id: %02X, version: %i.%02i)", 
data/spectemu-0.94a/tapefile.c:965:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(seg_desc, "Illegal tape type");
data/spectemu-0.94a/tapefile.c:969: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).
  tapefp = fopen(name, "rb");
data/spectemu-0.94a/tapefile.c:995:2:  [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(seg_desc, 
data/spectemu-0.94a/tapefile.c:1002: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(seg_desc, "Illegal TZX file header");
data/spectemu-0.94a/tapeout.c:57:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char soundbuf[SBUFSIZE];
data/spectemu-0.94a/tapeout.c:128:23:  [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).
  sound_sample_rate = atoi(argv[1]);
data/spectemu-0.94a/tapeout.c:132:30:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  if(argc > 3) start_block = atoi(argv[3]);
data/spectemu-0.94a/tapeout.c:135: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).
  snd = open(sound_dev_name, O_WRONLY | O_CREAT, 0644);
data/spectemu-0.94a/utils/recs.c:31: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(devname, O_RDONLY)) < 0) {
data/spectemu-0.94a/utils/recs.c:118:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buf[BUFSIZE];
data/spectemu-0.94a/utils/recs.c:130:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  else if((fp = fopen(filename, "wb")) == NULL) {
data/spectemu-0.94a/utils/recs.c:138:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    sample_rate = atol(argv[2]);
data/spectemu-0.94a/utils/recs.c:146:19:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    sample_size = atol(argv[3]);
data/spectemu-0.94a/utils/spconv/spconv.c:46: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 image[IMSIZE+0x100];
data/spectemu-0.94a/utils/spconv/spconv.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	my_directory[120];
data/spectemu-0.94a/utils/spconv/spconv.c:279: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		ext[5];
data/spectemu-0.94a/utils/spconv/spconv.c:487:5:  [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).
	fd=fopen(s,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:506:5:  [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).
	fd=fopen(s,"w");
data/spectemu-0.94a/utils/spconv/spconv.c:537:5:  [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).
	fd=fopen(s,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:578:5:  [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).
	fd=fopen(s,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:609:5:  [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).
	fd=fopen(s,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:727:5:  [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).
	fd=fopen(s,"w");
data/spectemu-0.94a/utils/spconv/spconv.c:758:5:  [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).
	fd=fopen(s,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:777: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		  buffer[1024];
data/spectemu-0.94a/utils/spconv/spconv.c:791:5:  [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).
	fd=fopen(s,"w");
data/spectemu-0.94a/utils/spconv/spconv.c:798:2:  [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(my_directory,"\\spectrum.rom");
data/spectemu-0.94a/utils/spconv/spconv.c:836: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).
			fd_specrom=fopen(rom,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:873:5:  [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).
	fd=fopen(s,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:892: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		  buffer[132];
data/spectemu-0.94a/utils/spconv/spconv.c:906:5:  [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).
	fd=fopen(s,"w");
data/spectemu-0.94a/utils/spconv/spconv.c:910:2:  [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(my_directory,"\\spectrum.rom");
data/spectemu-0.94a/utils/spconv/spconv.c:946: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).
			fd_specrom=fopen(rom,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:994:5:  [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).
	fd=fopen(s,"r");
data/spectemu-0.94a/utils/spconv/spconv.c:1072:5:  [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).
	fd=fopen(s,"w");
data/spectemu-0.94a/utils/spconv/spconv.h:110:9:  [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 in[9];
data/spectemu-0.94a/utils/spconv/spconv.h:135: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 signature[4];
data/spectemu-0.94a/utils/spconv/spconv.h:164: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.
	unsigned char emulator_switches[10];
data/spectemu-0.94a/utils/spconv/spconv.h:282:18:  [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.
/*27*/  unsigned char sound_reg[16];
data/spectemu-0.94a/utils/spconv/spconv.h:297:15:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
/*00*/	signed char name[10];
data/spectemu-0.94a/utils/spconv/spconv.h:302:18:  [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.
/*0E*/  unsigned char c_0x00[0xdc - 0x0e];
data/spectemu-0.94a/utils/spconv/spconv.h:325: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.
/*F2*/	unsigned char filler[0x0e];
data/spectemu-0.94a/utils/spconv/spconv.h:331: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.
/*01*/	unsigned char fill1[3];
data/spectemu-0.94a/utils/spconv/spconv.h:333: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.
/*05*/	unsigned char fill2[3];
data/spectemu-0.94a/utils/spconv/spconv.h:335: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.
/*09*/	unsigned char fill3[3];
data/spectemu-0.94a/utils/spconv/spconv.h:337:18:  [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.
/*0D*/  unsigned char fill4[3];
data/spectemu-0.94a/utils/spconv/spconv.h:339: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.
/*11*/	unsigned char fill5[3];
data/spectemu-0.94a/utils/spconv/spconv.h:341: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.
/*15*/	unsigned char fill6[3];
data/spectemu-0.94a/utils/spconv/spconv.h:343: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.
/*19*/	unsigned char fill7[3];
data/spectemu-0.94a/utils/spconv/spconv.h:345: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.
/*1D*/	unsigned char fill8[3];
data/spectemu-0.94a/utils/spconv/spconv.h:348: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.
/*22*/	unsigned char fill9[2];
data/spectemu-0.94a/utils/spconv/spconv.h:349:18:  [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.
/*24*/  unsigned char fill10[4];
data/spectemu-0.94a/utils/spconv/spconv.h:352: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.
/*2A*/	unsigned char fill11[0x94 - 0x2A];
data/spectemu-0.94a/utils/spconv/spconv.h:354: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.
/*95*/	unsigned char fill12[0x9C - 0x95];
data/spectemu-0.94a/utils/spconv/spconv.h:356: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.
/*9D*/	unsigned char fill13[0xa4 - 0x9D];
data/spectemu-0.94a/utils/spconv/spconv.h:358: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.
/*A5*/	unsigned char fill14[0xbe - 0xa5];
data/spectemu-0.94a/utils/spconv/spconv.h:361: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.
/*C0*/	unsigned char fill15[0xec - 0xc0];
data/spectemu-0.94a/utils/spconv/spconv.h:364: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.
/*EE*/	unsigned char fill16[2];
data/spectemu-0.94a/utils/spconv/spconv.h:367: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.
/*F2*/	unsigned char fill17[2];
data/spectemu-0.94a/utils/spconv/spconv.h:374:18:  [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.
/*FA*/  unsigned char fill18[2];
data/spectemu-0.94a/utils/spconv/spconv.h:377: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.
/*FE*/	unsigned char fill19[2];
data/spectemu-0.94a/utils/spconv/spconv.h:382: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.
/*00*/	unsigned char unused_1[0x84 - 0x00];
data/spectemu-0.94a/utils/spconv/spconv.h:383: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.
/*84*/	unsigned char settings[0x8E - 0x84];
data/spectemu-0.94a/utils/spconv/spconv.h:434: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.
/*C0*/	unsigned char unused_2[0xCA - 0xC0];
data/spectemu-0.94a/utils/spload.cc:23: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 buf[BUFSIZE];
data/spectemu-0.94a/utils/spload.cc:329:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	    FILE *fp = fopen("bufstor", "w");
data/spectemu-0.94a/utils/spload.cc:383:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buf[65536];
data/spectemu-0.94a/utils/spload.cc:392:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[11];
data/spectemu-0.94a/utils/spload.cc:403: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 datfilename[256];
data/spectemu-0.94a/utils/spload.cc:411:16:  [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).
    tapefile = fopen(datfilename, "w");
data/spectemu-0.94a/utils/spload.cc:475:17:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      datfile = fopen(datfilename, "w");
data/spectemu-0.94a/utils/spt2tap.c:13:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static char buf[MAXLEN];
data/spectemu-0.94a/utils/spt2tap.c:35:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[MAXLEN];
data/spectemu-0.94a/utils/spt2tap.c:50:3:  [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(filename, ".spt");
data/spectemu-0.94a/utils/spt2tap.c:51:9:  [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).
  spt = fopen(filename, "rt");
data/spectemu-0.94a/utils/spt2tap.c:60:3:  [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(filename, ".tap");
data/spectemu-0.94a/utils/spt2tap.c:61:9:  [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).
  tap = fopen(filename, "wb");
data/spectemu-0.94a/utils/spt2tap.c:69:15:  [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).
  else from = atoi(argv[3]);
data/spectemu-0.94a/utils/spt2tap.c:72:13:  [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).
  else to = atoi(argv[4]);
data/spectemu-0.94a/utils/spt2tap.c:85:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    blk = fopen(filename, "rb");
data/spectemu-0.94a/utils/tap2spt.c:11:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[MAXLEN];
data/spectemu-0.94a/utils/tap2spt.c:22:3:  [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(filename, ".tap");
data/spectemu-0.94a/utils/tap2spt.c:24:9:  [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).
  tap = fopen(filename, "rb");
data/spectemu-0.94a/utils/tap2spt.c:33:3:  [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(filename, ".spt");
data/spectemu-0.94a/utils/tap2spt.c:35:9:  [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).
  spt = fopen(filename, "wt");
data/spectemu-0.94a/utils/tap2spt.c:53:11:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    blk = fopen(filename, "wb");
data/spectemu-0.94a/utils/taplist.c:14:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[11];
data/spectemu-0.94a/xscr.c:490: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(msgbuf, "Translation not implemented (bpp: %i; scrmul: %i)",
data/spectemu-0.94a/xutils.c:246: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 resname[MAX_RES_NAME], resclass[MAX_RES_NAME];
data/spectemu-0.94a/xutils.c:247: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[MAXLINELEN+1];
data/spectemu-0.94a/xutils.c:264:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
  strcpy(resname+1, "color");
data/spectemu-0.94a/xutils.c:265:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
  strcpy(resclass+1, "Color");
data/spectemu-0.94a/xutils.c:268:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(resname+6, "%i", i);
data/spectemu-0.94a/xutils.c:269:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(resclass+6, "%i", i);
data/spectemu-0.94a/xutils.c:275:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
  strcpy(resname+1, "keys");
data/spectemu-0.94a/xutils.c:276:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
  strcpy(resclass+1, "Keys");
data/spectemu-0.94a/ax.c:394:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(class_name, defres->class_name, MAX_CLASS_NAME_LEN);
data/spectemu-0.94a/ax.c:409:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(prog_name, defres->prog_name, MAX_PROG_NAME_LEN);
data/spectemu-0.94a/ax.c:411:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(prog_name, argv[0], MAX_PROG_NAME_LEN);
data/spectemu-0.94a/bin_to_c.c:53:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while((c = getc(ifp)) != EOF) {
data/spectemu-0.94a/bin_to_c.c:87: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).
  outputfile = malloc(strlen(outprefix) + strlen(EXTENSION) + 1);
data/spectemu-0.94a/bin_to_c.c:87: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).
  outputfile = malloc(strlen(outprefix) + strlen(EXTENSION) + 1);
data/spectemu-0.94a/misc.c:47: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).
  flen = (int) strlen(filename);
data/spectemu-0.94a/misc.c:48: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).
  elen = (int) strlen(ext);
data/spectemu-0.94a/misc.c:65: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).
  i = (int) strlen(filename);
data/spectemu-0.94a/misc.c:93: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).
  tend = (int) strlen(filename);
data/spectemu-0.94a/misc.c:116:21:  [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).
  ostr = malloc_err(strlen(nstr) + 1);
data/spectemu-0.94a/snapshot.c:53:40:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define sngetc(snfp) ((snfp)->isfile ? getc((snfp)->fp) : snmgetc(snfp))
data/spectemu-0.94a/snapshot.c:621:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(filenamebuf, name, MAXFILENAME-10);
data/spectemu-0.94a/snapshot.c:670:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(filenamebuf, name, MAXFILENAME-10);
data/spectemu-0.94a/sp_to_s.c:285:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  c = getc(f);
data/spectemu-0.94a/spconf.c:115: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).
    if(line[0] && line[strlen(line)-1] != '\n') {
data/spectemu-0.94a/spconf.c:118:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(conffp);
data/spectemu-0.94a/spconf.c:124:40:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      while(c != EOF && c != '\n') c = getc(conffp);
data/spectemu-0.94a/spconf.c:259:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if(atcol + strlen(opt) + 2 >= MAXCOL) {
data/spectemu-0.94a/spconf.c:266: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).
  atcol += strlen(opt) + 2;
data/spectemu-0.94a/spconf.c:331:2:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
	strcat(optionstr, " ");
data/spectemu-0.94a/spconf.c:333: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).
      optionstr[strlen(optionstr)-1] = '>';
data/spectemu-0.94a/spconf.c:398: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).
  blen = strlen(beg);
data/spectemu-0.94a/spconf.c:418: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).
  blen = strlen(beg);
data/spectemu-0.94a/spconf.c:589:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(spkeyname, val, (size_t) len);
data/spectemu-0.94a/spconf.c:675:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(filenamebuf, argv[a], MAXFILENAME - 10);
data/spectemu-0.94a/spkey.c:820:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while(getchar() != '\n');
data/spectemu-0.94a/spmain.c:164:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(filenamebuf, DATADIR, MAXFILENAME-128);
data/spectemu-0.94a/spmain.c:165:3:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
  strcat(filenamebuf, "/");
data/spectemu-0.94a/spmain.c:178:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(filenamebuf, homedir, MAXFILENAME-128);
data/spectemu-0.94a/spmain.c:179:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(filenamebuf, "/");
data/spectemu-0.94a/sptape.c:96: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).
	me = me+strlen(me);
data/spectemu-0.94a/sptape.c:99: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).
	  me = me+strlen(me);
data/spectemu-0.94a/sptape.c:110: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).
	    me = me+strlen(me);
data/spectemu-0.94a/sptape.c:319:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      sprintf(msgbuf+strlen(msgbuf), "%3ik", datak);
data/spectemu-0.94a/sptape.c:461: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).
	  sprintf(msgbuf+strlen(msgbuf),
data/spectemu-0.94a/sptape.c:466:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(filename, (char*) recbuf+2, 10);
data/spectemu-0.94a/sptape.c:470:21:  [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(msgbuf+strlen(msgbuf),
data/spectemu-0.94a/sptape.c:593:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(tapename, name, MAXFILENAME-10);
data/spectemu-0.94a/sptape.c:652:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(tapename, name, MAXFILENAME-10);
data/spectemu-0.94a/tapefile.c:239:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  segid = getc(tapefp);
data/spectemu-0.94a/tapefile.c:328:10:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if(getc(tapefp) == EOF) {
data/spectemu-0.94a/tapefile.c:363:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  res = getc(tapefp);
data/spectemu-0.94a/tapefile.c:505: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).
      blen = (int) strlen(seg_desc);
data/spectemu-0.94a/tapefile.c:506:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(seg_desc+blen, (char *) rbuf, (unsigned) csp->len);
data/spectemu-0.94a/tapefile.c:613:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(seg_desc, (char *) rbuf, (unsigned) csp->len);
data/spectemu-0.94a/utils/filt.c:20:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while((c = getc(in)) != EOF) {
data/spectemu-0.94a/utils/recs.c:166:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      rd = read(snd, buf + at, BUFSIZE - at);
data/spectemu-0.94a/utils/spconv/spconv.c:165: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).
		outfile=malloc(strlen(argv[1])+strlen(argv[2])+1);
data/spectemu-0.94a/utils/spconv/spconv.c:165:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		outfile=malloc(strlen(argv[1])+strlen(argv[2])+1);
data/spectemu-0.94a/utils/spconv/spconv.c:173: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).
		outfile=malloc(strlen(argv[2])+1);
data/spectemu-0.94a/utils/spconv/spconv.c:1683:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(prg.name,n,10);
data/spectemu-0.94a/utils/spconv/spconv.c:1944:5:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		c=getc(fd);
data/spectemu-0.94a/utils/spconv/spconv.c:1951:6:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			c=getc(fd);
data/spectemu-0.94a/utils/spconv/spconv.c:1959:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				k=getc(fd);
data/spectemu-0.94a/utils/spconv/spconv.c:1962:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				c=getc(fd);
data/spectemu-0.94a/utils/spload.cc:75:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  for(; (c = getc(stdin)) != EOF; pos++) {
data/spectemu-0.94a/utils/spload.cc:439:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(filename, (char *) &buf[1], 10);
data/spectemu-0.94a/utils/spt2tap.c:105:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc(blk);
data/spectemu-0.94a/utils/tap2spt.c:45:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getc(tap);
data/spectemu-0.94a/utils/tap2spt.c:48:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    len = c + (getc(tap) << 8);
data/spectemu-0.94a/utils/tap2spt.c:62:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    i, getc(tap), len - 2);
data/spectemu-0.94a/utils/tap2spt.c:65:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      putc(getc(tap), blk);
data/spectemu-0.94a/utils/tap2spt.c:68:5:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    getc(tap);
data/spectemu-0.94a/utils/taplist.c:32:9:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getchar();
data/spectemu-0.94a/utils/taplist.c:39:9:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c = getchar();
data/spectemu-0.94a/utils/taplist.c:49:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getchar();
data/spectemu-0.94a/utils/taplist.c:65:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(filename, header+2, 10);
data/spectemu-0.94a/xscr.c:507:5:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    getchar();
data/spectemu-0.94a/xutils.c:256:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(resname+1, spcf_options[i].option, MAX_RES_NAME-2);
data/spectemu-0.94a/xutils.c:257:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(resclass+1, spcf_options[i].option, MAX_RES_NAME-2);
data/spectemu-0.94a/xutils.c:287:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(line, val, (size_t) i);

ANALYSIS SUMMARY:

Hits = 307
Lines analyzed = 21363 in approximately 0.50 seconds (42503 lines/second)
Physical Source Lines of Code (SLOC) = 15800
Hits@level = [0] 289 [1]  72 [2] 174 [3]   4 [4]  57 [5]   0
Hits@level+ = [0+] 596 [1+] 307 [2+] 235 [3+]  61 [4+]  57 [5+]   0
Hits/KSLOC@level+ = [0+] 37.7215 [1+] 19.4304 [2+] 14.8734 [3+] 3.86076 [4+] 3.60759 [5+]   0
Symlinks skipped = 3 (--allowlink overrides but see doc for security issue)
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.