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/towitoko-2.0.7/src/ct-api/ctapi.h
Examining data/towitoko-2.0.7/src/ct-api/ctbcs.h
Examining data/towitoko-2.0.7/src/ct-api/cardterminal.c
Examining data/towitoko-2.0.7/src/ct-api/ct_slot.c
Examining data/towitoko-2.0.7/src/ct-api/ct_list.c
Examining data/towitoko-2.0.7/src/ct-api/ctapi.c
Examining data/towitoko-2.0.7/src/ct-api/cardterminal.h
Examining data/towitoko-2.0.7/src/ct-api/ct_slot.h
Examining data/towitoko-2.0.7/src/ct-api/ct_list.h
Examining data/towitoko-2.0.7/src/ifd-handler/ifdhandler.c
Examining data/towitoko-2.0.7/src/ifd-handler/ifdhandler.h
Examining data/towitoko-2.0.7/src/ifd-handler/pcscdefines.h
Examining data/towitoko-2.0.7/src/driver/icc_async.c
Examining data/towitoko-2.0.7/src/driver/io_serial.c
Examining data/towitoko-2.0.7/src/driver/protocol_t0.c
Examining data/towitoko-2.0.7/src/driver/protocol_t1.c
Examining data/towitoko-2.0.7/src/driver/t1_block.c
Examining data/towitoko-2.0.7/src/driver/ifd_towitoko.c
Examining data/towitoko-2.0.7/src/driver/apdu.c
Examining data/towitoko-2.0.7/src/driver/icc_sync.c
Examining data/towitoko-2.0.7/src/driver/protocol_sync.c
Examining data/towitoko-2.0.7/src/driver/atr_sync.c
Examining data/towitoko-2.0.7/src/driver/pps.c
Examining data/towitoko-2.0.7/src/driver/tlv_object.c
Examining data/towitoko-2.0.7/src/driver/icc_async.h
Examining data/towitoko-2.0.7/src/driver/io_serial.h
Examining data/towitoko-2.0.7/src/driver/protocol_t0.h
Examining data/towitoko-2.0.7/src/driver/protocol_t1.h
Examining data/towitoko-2.0.7/src/driver/t1_block.h
Examining data/towitoko-2.0.7/src/driver/ifd_towitoko.h
Examining data/towitoko-2.0.7/src/driver/defines.h
Examining data/towitoko-2.0.7/src/driver/icc_sync.h
Examining data/towitoko-2.0.7/src/driver/apdu.h
Examining data/towitoko-2.0.7/src/driver/protocol_sync.h
Examining data/towitoko-2.0.7/src/driver/atr_sync.h
Examining data/towitoko-2.0.7/src/driver/pps.h
Examining data/towitoko-2.0.7/src/driver/tlv_object.h
Examining data/towitoko-2.0.7/src/driver/atr.c
Examining data/towitoko-2.0.7/src/driver/atr.h
Examining data/towitoko-2.0.7/src/test/tester.c

FINAL RESULTS:

data/towitoko-2.0.7/src/test/tester.c:193:7:  [4] (buffer) scanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
      scanf ("%s", option);
data/towitoko-2.0.7/src/ct-api/cardterminal.c:709: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,CARDTERMINAL_MANUFACTURER,5);
data/towitoko-2.0.7/src/ct-api/cardterminal.c:716: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+10,VERSION,5);
data/towitoko-2.0.7/src/ct-api/ct_slot.c:225: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 (buffer, userdata, buffer_len = MIN(length, PPS_MAX_LENGTH));
data/towitoko-2.0.7/src/ct-api/ctapi.c:267:15:  [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 (rsp, APDU_Rsp_Raw (apdu_rsp) + remain, (*lr));
data/towitoko-2.0.7/src/driver/apdu.c:57:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	  memcpy (apdu->command, data, length);
data/towitoko-2.0.7/src/driver/apdu.c:293:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy (apdu->response, data, length);
data/towitoko-2.0.7/src/driver/apdu.c:371:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy (response + APDU_Rsp_DataLen (apdu1), 
data/towitoko-2.0.7/src/driver/atr.c:107: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, atr_buffer, length);
data/towitoko-2.0.7/src/driver/atr.c:183: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 (atr->hb, buffer + pointer + 1, atr->hbn);
data/towitoko-2.0.7/src/driver/atr.c:527: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 (hist, atr->hb, atr->hbn);
data/towitoko-2.0.7/src/driver/atr.c:558: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[j]), atr->hb, atr->hbn);
data/towitoko-2.0.7/src/driver/icc_async.c:182: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, data, size);
data/towitoko-2.0.7/src/driver/icc_sync.c:372: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 (icc->pin, pin, ICC_SYNC_PIN_SIZE);
data/towitoko-2.0.7/src/driver/icc_sync.c:411: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 (icc->pin, pin, ICC_SYNC_PIN_SIZE);
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1083: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 + 1, data + pointer, IFD_TOWITOKO_PS);
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1102: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 + 1, data + pointer, remaining_length);
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1247: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 (w23 + 1, pin, IFD_TOWITOKO_PIN_SIZE);
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1516: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[3];
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1519: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 (desc,"CE2",MIN(length,3));
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1522: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 (desc,"CE1",MIN(length,3));
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1525: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 (desc,"CDI",MIN(length,3));
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1528: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 (desc,"CDM",MIN(length,3));
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1531: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 (desc,"KZ2",MIN(length,3));
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1534: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 (desc,"KZ1",MIN(length,3));
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1537: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 (desc,"UNK",MIN(length,3));
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:1542: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 (desc+3, buffer, MIN(length-3,2));
data/towitoko-2.0.7/src/driver/io_serial.c:94: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[IO_SERIAL_FILENAME_LENGTH];
data/towitoko-2.0.7/src/driver/io_serial.c:106: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).
  io->fd = open (filename, O_RDWR | O_NOCTTY);
data/towitoko-2.0.7/src/driver/io_serial.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 (pnp_id, io->PnP_id, io->PnP_id_size);
data/towitoko-2.0.7/src/driver/io_serial.c:639: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[IO_SERIAL_FILENAME_LENGTH];
data/towitoko-2.0.7/src/driver/io_serial.c:848: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 (io->props, props, sizeof (IO_Serial_Properties)); 
data/towitoko-2.0.7/src/driver/io_serial.c:856: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 (props, io->props, sizeof (IO_Serial_Properties)); 
data/towitoko-2.0.7/src/driver/io_serial.c:920: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 (filename, "COM%d", com);
data/towitoko-2.0.7/src/driver/pps.c:216: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 (params, confirm, len_confirm);
data/towitoko-2.0.7/src/driver/protocol_sync.c:235: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 (aid, APDU_Cmd_Data (cmd), aid_length);
data/towitoko-2.0.7/src/driver/protocol_sync.c:552: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 (pin, APDU_Cmd_Data (cmd), MIN (APDU_Cmd_Lc (cmd), ICC_SYNC_PIN_SIZE));
data/towitoko-2.0.7/src/driver/protocol_sync.c:599: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 (pin, APDU_Cmd_Data (cmd), ICC_SYNC_PIN_SIZE);
data/towitoko-2.0.7/src/driver/protocol_sync.c:600: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 (newpin, APDU_Cmd_Data (cmd) + ICC_SYNC_PIN_SIZE, ICC_SYNC_PIN_SIZE);
data/towitoko-2.0.7/src/driver/protocol_t0.c:192: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, APDU_Cmd_Raw (cmd), 4);
data/towitoko-2.0.7/src/driver/protocol_t0.c:244:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy (buffer, APDU_Cmd_Raw (cmd), 4);
data/towitoko-2.0.7/src/driver/protocol_t0.c:336: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, APDU_Cmd_Raw (cmd), APDU_Cmd_RawLen (cmd) - 1);
data/towitoko-2.0.7/src/driver/protocol_t0.c:428: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 + 5, APDU_Cmd_Data (cmd), buffer[4]);
data/towitoko-2.0.7/src/driver/protocol_t0.c:451:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy (buffer + 5, APDU_Cmd_Raw (cmd) + i, buffer[4]);
data/towitoko-2.0.7/src/driver/protocol_t0.c:553:15:  [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, APDU_Cmd_Raw (cmd), 4);
data/towitoko-2.0.7/src/driver/protocol_t0.c:650: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 + 5, APDU_Cmd_Data (cmd), buffer[4]);
data/towitoko-2.0.7/src/driver/protocol_t1.c:294:15:  [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 + counter, T1_Block_GetInf (block), bytes);
data/towitoko-2.0.7/src/driver/t1_block.c:60:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy (block->data, buffer, block->length);
data/towitoko-2.0.7/src/driver/t1_block.c:95:13:  [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 + 3, inf, len);
data/towitoko-2.0.7/src/driver/t1_block.c:157:13:  [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 + 3, inf, len);
data/towitoko-2.0.7/src/ifd-handler/ifdhandler.c:240: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 (Value, ifdh_context[ctn][slot]->icc_state.ATR, (*Length));
data/towitoko-2.0.7/src/ifd-handler/ifdhandler.c:329:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy (ifdh_context[ctn][slot]->icc_state.ATR, rsp, lr - 2);
data/towitoko-2.0.7/src/ifd-handler/ifdhandler.c:388:15:  [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 (ifdh_context[ctn][slot]->icc_state.ATR, rsp, lr - 2);
data/towitoko-2.0.7/src/ifd-handler/ifdhandler.c:391:15:  [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 (Atr, rsp, lr - 2);
data/towitoko-2.0.7/src/ifd-handler/ifdhandler.c:446:15:  [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 (ifdh_context[ctn][slot]->icc_state.ATR, rsp, lr - 2);
data/towitoko-2.0.7/src/ifd-handler/ifdhandler.c:449:15:  [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 (Atr, rsp, lr - 2);
data/towitoko-2.0.7/src/test/tester.c:54: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 port[16];		/* Descripton of port, printed in prompt */
data/towitoko-2.0.7/src/test/tester.c:56: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 atr[33];        /* ATR bytes */
data/towitoko-2.0.7/src/test/tester.c:97:26:  [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 short ReadPort (char port[16]);
data/towitoko-2.0.7/src/test/tester.c:145: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 option[32];
data/towitoko-2.0.7/src/test/tester.c:318: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 cmd[11], res[256], sad, dad;
data/towitoko-2.0.7/src/test/tester.c:379:11:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
          memcpy (ct_list[ctn].atr, res, lr - 2);
data/towitoko-2.0.7/src/test/tester.c:411: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 cmd[5], res[256], sad, dad;
data/towitoko-2.0.7/src/test/tester.c:471:15:  [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 (ct_list[ctn].atr, res, lr - 2);
data/towitoko-2.0.7/src/test/tester.c:501: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.
ReadPort(char port[16])
data/towitoko-2.0.7/src/test/tester.c:561: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 port[16];
data/towitoko-2.0.7/src/test/tester.c:639: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 port[16];
data/towitoko-2.0.7/src/test/tester.c:710:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buffer[32];
data/towitoko-2.0.7/src/test/tester.c:729: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 select_file[8] = { CLASS, 0xA4, 0x00, 0x00, 0x02, 0x3f, 0x00, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:730:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buffer[32];
data/towitoko-2.0.7/src/test/tester.c:731: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 res[256];
data/towitoko-2.0.7/src/test/tester.c:769: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 get_response[5] = { CLASS, 0xC0, 0x00, 0x00, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:770: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 buffer[32];
data/towitoko-2.0.7/src/test/tester.c:771: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 res[256];
data/towitoko-2.0.7/src/test/tester.c:807: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 update_binary[260] = { CLASS, 0xD6, 0x00, 0x00, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:808: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 buffer[32];
data/towitoko-2.0.7/src/test/tester.c:809: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 res[256];
data/towitoko-2.0.7/src/test/tester.c:851: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 read_binary[5] = { CLASS, 0xB0, 0x00, 0x00, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:852: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 buffer[32];
data/towitoko-2.0.7/src/test/tester.c:853: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 res[258];
data/towitoko-2.0.7/src/test/tester.c:890: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 verify_key[13] =
data/towitoko-2.0.7/src/test/tester.c:892: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 res[256];
data/towitoko-2.0.7/src/test/tester.c:921: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 reset[9] = {0x20, 0x11, 0x01, 0x01, 0x03, 0xFF, 0x00, 0x00, 0x00};
data/towitoko-2.0.7/src/test/tester.c:922:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buffer[32], res[256];
data/towitoko-2.0.7/src/test/tester.c:958: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 verify[8] = { 0x00, 0x20, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:959:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buffer[32];
data/towitoko-2.0.7/src/test/tester.c:960: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 res[256];
data/towitoko-2.0.7/src/test/tester.c:997: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 change[11] =
data/towitoko-2.0.7/src/test/tester.c:999:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buffer[32];
data/towitoko-2.0.7/src/test/tester.c:1000: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 res[256];
data/towitoko-2.0.7/src/test/tester.c:1045: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 select_file[7] = { 0x00, 0xA4, 0x00, 0x00, 0x02, 0x3F, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:1046: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 read_binary[6] = { 0x00, 0xB0, 0x00, 0x00, 0x00, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:1134: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 select_file[7] = { 0x00, 0xA4, 0x00, 0x00, 0x02, 0x3F, 0x00 };
data/towitoko-2.0.7/src/test/tester.c:1138:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char buffer[32];
data/towitoko-2.0.7/src/test/tester.c:1139: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 res[256];
data/towitoko-2.0.7/src/ct-api/ct_slot.c:110:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep (1000);
data/towitoko-2.0.7/src/driver/icc_sync.c:321:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
	  usleep (90000);
data/towitoko-2.0.7/src/driver/ifd_towitoko.c:299:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
  usleep (150000L);
data/towitoko-2.0.7/src/driver/io_serial.c:550:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	  if (read (io->fd, &c, 1) != 1)
data/towitoko-2.0.7/src/driver/io_serial.c:753:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep ((unsigned long) (delay_ms * 1000L));
data/towitoko-2.0.7/src/driver/io_serial.c:800:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep ((unsigned long) (delay_ms * 1000L));
data/towitoko-2.0.7/src/test/tester.c:194:15:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:397:11:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
          usleep (999999);
data/towitoko-2.0.7/src/test/tester.c:492:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
      usleep(999999);
data/towitoko-2.0.7/src/test/tester.c:505:3:  [1] (buffer) scanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
  scanf("%6s", port);
data/towitoko-2.0.7/src/test/tester.c:599:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(ct_list[ctn].port,port,16);
data/towitoko-2.0.7/src/test/tester.c:625:9:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        usleep(100000);
data/towitoko-2.0.7/src/test/tester.c:715:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:742:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:782:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:820:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:825:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:865:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:930:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:969:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:1009:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:1017:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:1058:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:1067:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:1148:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:1154:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();
data/towitoko-2.0.7/src/test/tester.c:1158:11:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  dummy = getchar ();

ANALYSIS SUMMARY:

Hits = 122
Lines analyzed = 13665 in approximately 0.31 seconds (44042 lines/second)
Physical Source Lines of Code (SLOC) = 9128
Hits@level = [0] 256 [1]  27 [2]  94 [3]   0 [4]   1 [5]   0
Hits@level+ = [0+] 378 [1+] 122 [2+]  95 [3+]   1 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 41.411 [1+] 13.3655 [2+] 10.4075 [3+] 0.109553 [4+] 0.109553 [5+]   0
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.