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/libspectrum-1.4.4/myglib/garray.c
Examining data/libspectrum-1.4.4/myglib/ghash.c
Examining data/libspectrum-1.4.4/myglib/gslist.c
Examining data/libspectrum-1.4.4/myglib/glock.c
Examining data/libspectrum-1.4.4/test/test.h
Examining data/libspectrum-1.4.4/test/edges.c
Examining data/libspectrum-1.4.4/test/szx.c
Examining data/libspectrum-1.4.4/test/test.c
Examining data/libspectrum-1.4.4/test/test_edges.c
Examining data/libspectrum-1.4.4/internals.h
Examining data/libspectrum-1.4.4/zip.h
Examining data/libspectrum-1.4.4/bzip2.c
Examining data/libspectrum-1.4.4/buffer.c
Examining data/libspectrum-1.4.4/creator.c
Examining data/libspectrum-1.4.4/crypto.c
Examining data/libspectrum-1.4.4/csw.c
Examining data/libspectrum-1.4.4/dck.c
Examining data/libspectrum-1.4.4/ide.c
Examining data/libspectrum-1.4.4/libspectrum.c
Examining data/libspectrum-1.4.4/memory.c
Examining data/libspectrum-1.4.4/microdrive.c
Examining data/libspectrum-1.4.4/mmc.c
Examining data/libspectrum-1.4.4/plusd.c
Examining data/libspectrum-1.4.4/pzx_read.c
Examining data/libspectrum-1.4.4/rzx.c
Examining data/libspectrum-1.4.4/sna.c
Examining data/libspectrum-1.4.4/snp.c
Examining data/libspectrum-1.4.4/snapshot.c
Examining data/libspectrum-1.4.4/snap_accessors.c
Examining data/libspectrum-1.4.4/sp.c
Examining data/libspectrum-1.4.4/symbol_table.c
Examining data/libspectrum-1.4.4/szx.c
Examining data/libspectrum-1.4.4/tap.c
Examining data/libspectrum-1.4.4/tape.c
Examining data/libspectrum-1.4.4/tape_accessors.c
Examining data/libspectrum-1.4.4/tape_block.c
Examining data/libspectrum-1.4.4/tape_set.c
Examining data/libspectrum-1.4.4/timings.c
Examining data/libspectrum-1.4.4/tzx_read.c
Examining data/libspectrum-1.4.4/tzx_write.c
Examining data/libspectrum-1.4.4/utilities.c
Examining data/libspectrum-1.4.4/warajevo_read.c
Examining data/libspectrum-1.4.4/wav.c
Examining data/libspectrum-1.4.4/z80.c
Examining data/libspectrum-1.4.4/z80em.c
Examining data/libspectrum-1.4.4/zxs.c
Examining data/libspectrum-1.4.4/zip.c
Examining data/libspectrum-1.4.4/zlib.c
Examining data/libspectrum-1.4.4/dll.c
Examining data/libspectrum-1.4.4/make-perl.c
Examining data/libspectrum-1.4.4/tape_block.h

FINAL RESULTS:

data/libspectrum-1.4.4/dck.c:45:13:  [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.
    (*dck)->access[i] = LIBSPECTRUM_DCK_PAGE_NULL;
data/libspectrum-1.4.4/dck.c:197:55:  [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.
    for( i = 0; i < 8; i++ ) dck->dck[num_dck_block]->access[i] = *buffer++;
data/libspectrum-1.4.4/dck.c:201:40:  [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.
      switch( dck->dck[num_dck_block]->access[i] ) {
data/libspectrum-1.4.4/internals.h:38:63:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define GCC_PRINTF( fmtstring, args ) __attribute__ ((format( printf, fmtstring, args )))
data/libspectrum-1.4.4/internals.h:92:9:  [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 snprintf _snprintf
data/libspectrum-1.4.4/internals.h:92:18:  [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 snprintf _snprintf
data/libspectrum-1.4.4/libspectrum.c:199:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf( stderr, format, ap );
data/libspectrum-1.4.4/test/szx.c:612:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf( filename, 256, template, id );
data/libspectrum-1.4.4/zip.c:343: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( info->name, z->file_name );
data/libspectrum-1.4.4/buffer.c:135:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( buffer->buffer + buffer->bytes_used, data, size );
data/libspectrum-1.4.4/buffer.c:176:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( *ptr, src->buffer, src->bytes_used );
data/libspectrum-1.4.4/creator.c:33: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 program[32];
data/libspectrum-1.4.4/csw.c:130:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( csw_block->data, buffer, length );
data/libspectrum-1.4.4/dck.c:218:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy( dck->dck[num_dck_block]->pages[i], buffer, DCK_PAGE_SIZE );
data/libspectrum-1.4.4/ide.c:204:7:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  f = fopen( filename, "rb+" );
data/libspectrum-1.4.4/ide.c:458:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( dest, buffer, 512 );
data/libspectrum-1.4.4/ide.c:499:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( buffer, src, 512 );
data/libspectrum-1.4.4/ide.c:739:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( &chn->buffer[0], &drv->hdf.drive_identity[0], 0x6a );
data/libspectrum-1.4.4/libspectrum.c:918:17:  [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( *new_buffer, xfdobj->xfdbi_TargetBuffer, *new_length );
data/libspectrum-1.4.4/microdrive.c:134:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( block->hdbnam, d, 10 ); d += 10; block->hdbnam[10] = '\0';
data/libspectrum-1.4.4/microdrive.c:141:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( block->recnam, d, 10 ); d += 10; block->recnam[10] = '\0';
data/libspectrum-1.4.4/microdrive.c:145:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( block->data, d, 512 ); d += 512;
data/libspectrum-1.4.4/microdrive.c:161:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( d, block->hdbnam, 10 ); d += 10;
data/libspectrum-1.4.4/microdrive.c:168:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( d, block->recnam, 10 ); d += 10;
data/libspectrum-1.4.4/microdrive.c:172:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( d, block->data, 512 ); d += 512;
data/libspectrum-1.4.4/microdrive.c:272:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( microdrive->data, buffer, data_length ); buffer += data_length;
data/libspectrum-1.4.4/microdrive.c:292:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( *buffer, microdrive->data, *length );
data/libspectrum-1.4.4/mmc.c:517:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( &card->response_buffer[ 2 + 1 ], "  ", 2 );
data/libspectrum-1.4.4/mmc.c:520:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( &card->response_buffer[ 2 + 3 ], "Fuse", 4 );
data/libspectrum-1.4.4/myglib/garray.c:85:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( array->data + array->len * array->element_size,
data/libspectrum-1.4.4/myglib/garray.c:109:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( array->data + index * array->element_size,
data/libspectrum-1.4.4/plusd.c:213:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( ram, buffer, 0x4000 );
data/libspectrum-1.4.4/pzx_read.c:525:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( id, *buffer, 4 ); id[4] = '\0'; *buffer += 4;
data/libspectrum-1.4.4/pzx_read.c:535: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 id[5];
data/libspectrum-1.4.4/pzx_read.c:629:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( *data, *ptr, length ); *ptr += length;
data/libspectrum-1.4.4/rzx.c:464:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( frame->in_bytes, in_bytes,
data/libspectrum-1.4.4/rzx.c:1107:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( block->frames[i].in_bytes, *ptr, block->frames[i].count );
data/libspectrum-1.4.4/rzx.c:1695:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( &( input->frames[input->count] ), next_input->frames,
data/libspectrum-1.4.4/sna.c:188:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( libspectrum_snap_pages( snap, 5 ), &buffer[0x0000], 0x4000 );
data/libspectrum-1.4.4/sna.c:189:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( libspectrum_snap_pages( snap, 2 ), &buffer[0x4000], 0x4000 );
data/libspectrum-1.4.4/sna.c:206:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( libspectrum_snap_pages( snap, page ), &buffer[0x8000], 0x4000 );
data/libspectrum-1.4.4/sna.c:265:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( libspectrum_snap_pages( snap, i ), buffer, 0x4000 );
data/libspectrum-1.4.4/snapshot.c:545:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( libspectrum_snap_pages( snap, 5 ), &data[0x0000], 0x4000 );
data/libspectrum-1.4.4/snapshot.c:546:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( libspectrum_snap_pages( snap, 2 ), &data[0x4000], 0x4000 );
data/libspectrum-1.4.4/snapshot.c:547:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( libspectrum_snap_pages( snap, 0 ), &data[0x8000], 0x4000 );
data/libspectrum-1.4.4/sp.c:119:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( &memory[ start ], buffer, memory_length );
data/libspectrum-1.4.4/szx.c:435:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( *data, *buffer, uncompressed_length );
data/libspectrum-1.4.4/szx.c:582:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( rom_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:639:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( custom, *buffer, data_length );
data/libspectrum-1.4.4/szx.c:841:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( ram_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:847:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( rom_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:1026:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( ram_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:1031:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( rom_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:1628:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( rom_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:1646:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( page, rom_data, length );
data/libspectrum-1.4.4/szx.c:1755:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( rom_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:1998:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( eprom_data, *buffer, expected_length );
data/libspectrum-1.4.4/szx.c:2162:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( data_out, data, 0x20000 );
data/libspectrum-1.4.4/szx.c:2212:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( w5100, *buffer, 0x30 );
data/libspectrum-1.4.4/szx.c:2307:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( palette, *buffer, 64 );
data/libspectrum-1.4.4/szx.c:2418:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( ram_data, *buffer, expected_ram_length );
data/libspectrum-1.4.4/szx.c:2529:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( id, *buffer, 4 ); id[4] = '\0'; *buffer += 4;
data/libspectrum-1.4.4/szx.c:2540: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 id[5];
data/libspectrum-1.4.4/tap.c:105:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( data, ptr, buf_length );
data/libspectrum-1.4.4/tap.c:311: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 description[ DESCRIPTION_LENGTH ];
data/libspectrum-1.4.4/test/szx.c:70:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( id, data, 4 );
data/libspectrum-1.4.4/test/szx.c:73:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( length_buffer, data, 4 );
data/libspectrum-1.4.4/test/szx.c:87:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( chunk_data, data, length );
data/libspectrum-1.4.4/test/szx.c:606: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[ 256 ];
data/libspectrum-1.4.4/test/test.c:30:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fd = open( filename, O_RDONLY | O_BINARY );
data/libspectrum-1.4.4/test/test.c:994:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      int begin = atoi( spec ), end = atoi( dash + 1 );
data/libspectrum-1.4.4/test/test.c:994:39:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      int begin = atoi( spec ), end = atoi( dash + 1 );
data/libspectrum-1.4.4/test/test.c:999:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      int test = atoi( spec );
data/libspectrum-1.4.4/tzx_read.c:656:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( data, *ptr, data_count * sizeof( *data ) );
data/libspectrum-1.4.4/tzx_read.c:1099:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( description, *ptr, 16 ); (*ptr) += 16; description[16] = '\0';
data/libspectrum-1.4.4/tzx_read.c:1172:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( *data, *ptr, *length ); *ptr += *length;
data/libspectrum-1.4.4/tzx_write.c:896:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( data, libspectrum_tape_block_data( block ), data_length );
data/libspectrum-1.4.4/warajevo_read.c:280:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( dest + *bytes_written,
data/libspectrum-1.4.4/warajevo_read.c:487:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( block_data + 1, data, length - 2 );
data/libspectrum-1.4.4/warajevo_read.c:547:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( block_data, data, length );
data/libspectrum-1.4.4/warajevo_read.c:599:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( block_data + libspectrum_tape_block_data_length( last_block ),
data/libspectrum-1.4.4/z80.c:832:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( buffer, (*next_block) + screen_offset, 6912 );
data/libspectrum-1.4.4/z80.c:897:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( chunk, uncompressed, 0x4000 );
data/libspectrum-1.4.4/z80.c:909:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( chunk, uncompressed, 0x2000 );
data/libspectrum-1.4.4/z80.c:912:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( chunk, uncompressed + 0x2000, 0x2000 );
data/libspectrum-1.4.4/z80.c:1050:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( *uncompressed, buffer, 0xc000 );
data/libspectrum-1.4.4/z80.c:1103:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( *block, buffer + 3, 0x4000 );
data/libspectrum-1.4.4/z80.c:1552:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( uncompressed, libspectrum_snap_interface1_rom( snap, 0 ),
data/libspectrum-1.4.4/z80.c:1567:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( uncompressed, libspectrum_snap_plusd_rom( snap, 0 ), 0x2000 );
data/libspectrum-1.4.4/z80.c:1568:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( uncompressed + 0x2000,
data/libspectrum-1.4.4/z80.c:1680:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( compressed_screen, libspectrum_snap_slt_screen( snap ), 6912 );
data/libspectrum-1.4.4/z80em.c:68:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( z80em_block->data, buffer, length );
data/libspectrum-1.4.4/zip.c:287:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy( z->file_name, z->ptr, name_size );
data/libspectrum-1.4.4/zip.c:536:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( *buffer, z->ptr, *size );
data/libspectrum-1.4.4/zip.h:119: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 name[1024];
data/libspectrum-1.4.4/zip.h:154: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 file_name[1024];
data/libspectrum-1.4.4/zxs.c:77:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( &zlib_buffer[2], *compressed, compressed_length );
data/libspectrum-1.4.4/zxs.c:138: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 id[5];
data/libspectrum-1.4.4/zxs.c:149:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( id, *buffer, 4 ); id[4] = '\0'; *buffer += 4;
data/libspectrum-1.4.4/zxs.c:380:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy( buffer2, buffer, 0x4000 ); *buffer += 0x4000;
data/libspectrum-1.4.4/zxs.c:441:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy( id, *buffer, 4 ); id[4] = '\0'; *buffer += 4;
data/libspectrum-1.4.4/zxs.c:451: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 id[5];
data/libspectrum-1.4.4/crypto.c:228:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  pair = gcry_sexp_find_token( sexp, token, strlen( token ) );
data/libspectrum-1.4.4/csw.c:43: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).
  size_t signature_length = strlen( csw_signature );
data/libspectrum-1.4.4/csw.c:309:56:  [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).
  libspectrum_buffer_write( new_buffer, csw_signature, strlen( csw_signature ) );
data/libspectrum-1.4.4/libspectrum.c:799:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      if( strlen( *new_filename ) >= 4 &&
data/libspectrum-1.4.4/libspectrum.c:800:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	  !strcasecmp( &(*new_filename)[ strlen( *new_filename ) - 4 ],
data/libspectrum-1.4.4/libspectrum.c:802: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).
	(*new_filename)[ strlen( *new_filename ) - 4 ] = '\0';
data/libspectrum-1.4.4/libspectrum.c:830:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      if( strlen( *new_filename ) >= 3 &&
data/libspectrum-1.4.4/libspectrum.c:831:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	  !strcasecmp( &(*new_filename)[ strlen( *new_filename ) - 3 ],
data/libspectrum-1.4.4/libspectrum.c:833: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).
	(*new_filename)[ strlen( *new_filename ) - 3 ] = '\0';
data/libspectrum-1.4.4/libspectrum.c:858:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      if( strlen( *new_filename ) >= 4 &&
data/libspectrum-1.4.4/libspectrum.c:859:42:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          !strcasecmp( &(*new_filename)[ strlen( *new_filename ) - 4 ],
data/libspectrum-1.4.4/libspectrum.c:861: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).
      (*new_filename)[ strlen( *new_filename ) - 4 ] = '\0';
data/libspectrum-1.4.4/pzx_read.c:192: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).
      size_t new_len = strlen( info_tag ) + strlen( string ) +
data/libspectrum-1.4.4/pzx_read.c:192:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      size_t new_len = strlen( info_tag ) + strlen( string ) +
data/libspectrum-1.4.4/pzx_read.c:193: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).
                       strlen( ": " ) + 1;
data/libspectrum-1.4.4/pzx_read.c:659:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy( *dest, buffer, length );
data/libspectrum-1.4.4/rzx.c:781:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if( end - (*ptr) < (ptrdiff_t)strlen( rzx_signature ) + 6 ) {
data/libspectrum-1.4.4/rzx.c:788:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if( memcmp( *ptr, rzx_signature, strlen( rzx_signature ) ) ) {
data/libspectrum-1.4.4/rzx.c:795: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).
  (*ptr) += strlen( rzx_signature ) + 2;
data/libspectrum-1.4.4/rzx.c:1322:52:  [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).
  libspectrum_buffer_write( buffer, rzx_signature, strlen( rzx_signature ) );
data/libspectrum-1.4.4/rzx.c:1546:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if( !key || !key->y || strlen( key->y ) < 8 ) {
data/libspectrum-1.4.4/rzx.c:1553:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    block_data, strtoul( &key->y[ strlen( key->y ) - 8 ], NULL, 16 )
data/libspectrum-1.4.4/szx.c:645: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).
      libspectrum += strlen( libspectrum_string );
data/libspectrum-1.4.4/tape.c:1369:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Standard Speed Data", length );
data/libspectrum-1.4.4/tape.c:1372:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Turbo Speed Data", length );
data/libspectrum-1.4.4/tape.c:1375:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Pure Tone", length );
data/libspectrum-1.4.4/tape.c:1378:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "List of Pulses", length );
data/libspectrum-1.4.4/tape.c:1381:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Pure Data", length );
data/libspectrum-1.4.4/tape.c:1384:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Raw Data", length );
data/libspectrum-1.4.4/tape.c:1388:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Generalised Data", length );
data/libspectrum-1.4.4/tape.c:1392:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Pause", length );
data/libspectrum-1.4.4/tape.c:1395:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Group Start", length );
data/libspectrum-1.4.4/tape.c:1398:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Group End", length );
data/libspectrum-1.4.4/tape.c:1401:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Jump", length );
data/libspectrum-1.4.4/tape.c:1404:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Loop Start Block", length );
data/libspectrum-1.4.4/tape.c:1407:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Loop End", length );
data/libspectrum-1.4.4/tape.c:1411:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Select", length );
data/libspectrum-1.4.4/tape.c:1415:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Stop Tape If In 48K Mode", length );
data/libspectrum-1.4.4/tape.c:1419:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Set Signal Level", length );
data/libspectrum-1.4.4/tape.c:1423:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Comment", length );
data/libspectrum-1.4.4/tape.c:1426:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Message", length );
data/libspectrum-1.4.4/tape.c:1429:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Archive Info", length );
data/libspectrum-1.4.4/tape.c:1432:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Hardware Information", length );
data/libspectrum-1.4.4/tape.c:1436:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Custom Info", length );
data/libspectrum-1.4.4/tape.c:1440:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "RLE Pulse", length );
data/libspectrum-1.4.4/tape.c:1444:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Pulse Sequence", length );
data/libspectrum-1.4.4/tape.c:1448:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy( buffer, "Data Block", length );
data/libspectrum-1.4.4/test/test.c:46:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  bytes = read( fd, *buffer, *length );
data/libspectrum-1.4.4/tzx_read.c:121: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).
  size_t signature_length = strlen( libspectrum_tzx_signature );
data/libspectrum-1.4.4/tzx_read.c:1118: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).
  size_t signature_length = strlen( libspectrum_tzx_signature );
data/libspectrum-1.4.4/tzx_write.c:109: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).
  size_t signature_length = strlen( libspectrum_tzx_signature );
data/libspectrum-1.4.4/tzx_write.c:528: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).
    total_length += strlen( (char*)libspectrum_tape_block_texts( block, i ) );
data/libspectrum-1.4.4/tzx_write.c:587: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).
    total_length += strlen( (char*)libspectrum_tape_block_texts( block, i ) );
data/libspectrum-1.4.4/tzx_write.c:935: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).
  size_t i, length = strlen( (char*)string );
data/libspectrum-1.4.4/zip.c:347:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  length = strlen( z->file_name );
data/libspectrum-1.4.4/zip.c:379:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if( !filename || strlen( filename ) == 0 ) return -1;
data/libspectrum-1.4.4/zip.c:402: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).
    if( !fname || strlen( fname ) == 0 ) continue;
data/libspectrum-1.4.4/zip.c:405: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).
    length = strlen( fname );

ANALYSIS SUMMARY:

Hits = 160
Lines analyzed = 31055 in approximately 0.63 seconds (49468 lines/second)
Physical Source Lines of Code (SLOC) = 22686
Hits@level = [0] 129 [1]  58 [2]  93 [3]   0 [4]   9 [5]   0
Hits@level+ = [0+] 289 [1+] 160 [2+] 102 [3+]   9 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 12.7391 [1+] 7.05281 [2+] 4.49617 [3+] 0.39672 [4+] 0.39672 [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.