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/cackey-0.7.10/asn1-x509.c
Examining data/cackey-0.7.10/asn1-x509.h
Examining data/cackey-0.7.10/build/cackey_win32_build/include/pcsclite.h
Examining data/cackey-0.7.10/build/cackey_win32_build/include/pthread.h
Examining data/cackey-0.7.10/build/cackey_win32_build/include/zconf.h
Examining data/cackey-0.7.10/build/cackey_win32_build/include/zlib.h
Examining data/cackey-0.7.10/build/cackey_win64_build/include/pcsclite.h
Examining data/cackey-0.7.10/build/cackey_win64_build/include/pthread.h
Examining data/cackey-0.7.10/build/cackey_win64_build/include/zconf.h
Examining data/cackey-0.7.10/build/cackey_win64_build/include/zlib.h
Examining data/cackey-0.7.10/cackey.c
Examining data/cackey-0.7.10/cackey_builtin_certs.h
Examining data/cackey-0.7.10/libcackey_wrap.c
Examining data/cackey-0.7.10/md5.c
Examining data/cackey-0.7.10/md5.h
Examining data/cackey-0.7.10/pkcs11/mypkcs11.h
Examining data/cackey-0.7.10/pkcs11/pkcs11.h
Examining data/cackey-0.7.10/pkcs11/pkcs11f.h
Examining data/cackey-0.7.10/pkcs11/pkcs11n.h
Examining data/cackey-0.7.10/pkcs11/pkcs11t.h
Examining data/cackey-0.7.10/sha-private.h
Examining data/cackey-0.7.10/sha.h
Examining data/cackey-0.7.10/sha1.c
Examining data/cackey-0.7.10/test.c

FINAL RESULTS:

data/cackey-0.7.10/cackey.c:216:2:  [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(buf_user, sizeof(buf_user), x); \
data/cackey-0.7.10/cackey.c:4560:10:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	pinfd = popen(cackey_pin_command, "r");
data/cackey-0.7.10/cackey.c:264:12:  [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.
	logfile = getenv("CACKEY_DEBUG_LOGFILE");
data/cackey-0.7.10/cackey.c:270:14:  [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.
			logfile = getenv("CACKEY_DEBUG_LOGFILE");
data/cackey-0.7.10/cackey.c:4457:6:  [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 (getenv("CACKEY_DOD_CERTS_ON_HW_SLOTS") != NULL) {
data/cackey-0.7.10/cackey.c:4461:6:  [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 (getenv("CACKEY_NO_DOD_CERTS_ON_HW_SLOTS") != NULL) {
data/cackey-0.7.10/cackey.c:4466:6:  [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 (getenv("CACKEY_EXTRA_CERTS") != NULL) {
data/cackey-0.7.10/cackey.c:4472:6:  [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 (getenv("CACKEY_NO_EXTRA_CERTS") != NULL) {
data/cackey-0.7.10/cackey.c:4648:6:  [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 (getenv("CACKEY_EXTRA_CERTS") != NULL) {
data/cackey-0.7.10/cackey.c:4654:6:  [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 (getenv("CACKEY_NO_EXTRA_CERTS") != NULL) {
data/cackey-0.7.10/cackey.c:4695:6:  [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 (getenv("DISPLAY") != NULL) {
data/cackey-0.7.10/cackey.c:4700:6:  [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 (getenv("CACKEY_PIN_COMMAND") != NULL) {
data/cackey-0.7.10/cackey.c:4701:31:  [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.
		cackey_pin_command = strdup(getenv("CACKEY_PIN_COMMAND"));
data/cackey-0.7.10/cackey.c:4704:6:  [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 (getenv("CACKEY_PIN_COMMAND_XONLY") != NULL && getenv("DISPLAY") != NULL) {
data/cackey-0.7.10/cackey.c:4704:52:  [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 (getenv("CACKEY_PIN_COMMAND_XONLY") != NULL && getenv("DISPLAY") != NULL) {
data/cackey-0.7.10/cackey.c:4705:31:  [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.
		cackey_pin_command = strdup(getenv("CACKEY_PIN_COMMAND_XONLY"));
data/cackey-0.7.10/cackey.c:4721:6:  [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 (getenv("CACKEY_READERS_INCLUDE_ONLY") != NULL) {
data/cackey-0.7.10/cackey.c:4722:40:  [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.
		cackey_readers_include_only = strdup(getenv("CACKEY_READERS_INCLUDE_ONLY"));
data/cackey-0.7.10/cackey.c:4731:6:  [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 (getenv("CACKEY_READERS_EXCLUDE") != NULL) {
data/cackey-0.7.10/cackey.c:4732:35:  [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.
		cackey_readers_exclude = strdup(getenv("CACKEY_READERS_EXCLUDE"));
data/cackey-0.7.10/cackey.c:215: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.
	static char buf_user[4096] = {0}; \
data/cackey-0.7.10/cackey.c:222: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.
	static char buf_user[8192] = {0}, *buf_user_p, *buf_user_print; \
data/cackey-0.7.10/cackey.c:285: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).
		fd = fopen(logfile, "a");
data/cackey-0.7.10/cackey.c:749:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			unsigned char applet[7];
data/cackey-0.7.10/cackey.c:755:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			char label[32];
data/cackey-0.7.10/cackey.c:860: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        rid[5];
data/cackey-0.7.10/cackey.c:1740: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(respdata, recv_buf, bytes_to_copy);
data/cackey-0.7.10/cackey.c:1872: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(outbuffer, buffer_p, size);
data/cackey-0.7.10/cackey.c:1916:67:  [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 ssize_t cackey_get_data(struct cackey_slot *slot, unsigned char *buffer, size_t buffer_len, unsigned char oid[3]) {
data/cackey-0.7.10/cackey.c:1916:109:  [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 ssize_t cackey_get_data(struct cackey_slot *slot, unsigned char *buffer, size_t buffer_len, unsigned char oid[3]) {
data/cackey-0.7.10/cackey.c:2012: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 cmd[2];
data/cackey-0.7.10/cackey.c:2262: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 fid_buf[2];
data/cackey-0.7.10/cackey.c:2347: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 tlen_buf[2], tval_buf[1024], *tval;
data/cackey-0.7.10/cackey.c:2348: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 vlen_buf[2], vval_buf[8192], *vval;
data/cackey-0.7.10/cackey.c:2437: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(curr_entity->value_cardurl->rid, vval, 5);
data/cackey-0.7.10/cackey.c:2450: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(tmpbuf, vval, length);
data/cackey-0.7.10/cackey.c:2470:6:  [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(tmpbuf, vval, length);
data/cackey-0.7.10/cackey.c:2478: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(tmpbuf, vval, length);
data/cackey-0.7.10/cackey.c:2580: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[idx].certificate, start[idx].certificate, dest[idx].certificate_len);
data/cackey-0.7.10/cackey.c:2605: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 curr_aid[7];
data/cackey-0.7.10/cackey.c:2606: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 buffer[8192], *buffer_p, *tmpbuf;
data/cackey-0.7.10/cackey.c:2749: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(curr_id->card.piv.label, piv_label, strlen(piv_label) + 1);
data/cackey-0.7.10/cackey.c:2854: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(curr_aid, ccc_curr->value_cardurl->rid, sizeof(ccc_curr->value_cardurl->rid));
data/cackey-0.7.10/cackey.c:2899: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(curr_id->certificate, app_curr->value, curr_id->certificate_len);
data/cackey-0.7.10/cackey.c:2962: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 dyn_auth_template[10], *dyn_auth_tmpbuf;
data/cackey-0.7.10/cackey.c:3050: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(&tmpbuf[padlen + 3], buf, buflen);
data/cackey-0.7.10/cackey.c:3100: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(dyn_auth_tmpbuf, dyn_auth_template, sizeof(dyn_auth_template));
data/cackey-0.7.10/cackey.c:3101: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(dyn_auth_tmpbuf + sizeof(dyn_auth_template), tmpbuf, tmpbuflen);
data/cackey-0.7.10/cackey.c:3480: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 cac_pin[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
data/cackey-0.7.10/cackey.c:3481: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 old_cac_pin[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
data/cackey-0.7.10/cackey.c:3482: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 pin_update[sizeof(cac_pin) + sizeof(old_cac_pin)];
data/cackey-0.7.10/cackey.c:3491: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(cac_pin, pin, 8);
data/cackey-0.7.10/cackey.c:3493: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(cac_pin, pin, pin_len);
data/cackey-0.7.10/cackey.c:3497: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(old_cac_pin, old_pin, 8);
data/cackey-0.7.10/cackey.c:3499: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(old_cac_pin, old_pin, old_pin_len);
data/cackey-0.7.10/cackey.c:3503: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(pin_update, old_cac_pin, sizeof(old_cac_pin));
data/cackey-0.7.10/cackey.c:3504: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(pin_update + sizeof(old_cac_pin), cac_pin, sizeof(cac_pin));
data/cackey-0.7.10/cackey.c:3580: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 cac_pin[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
data/cackey-0.7.10/cackey.c:3595: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(cac_pin, pin, 8);
data/cackey-0.7.10/cackey.c:3597: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(cac_pin, pin, pin_len);
data/cackey-0.7.10/cackey.c:4354: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(curr_attr.pValue, pValue, curr_attr.ulValueLen);
data/cackey-0.7.10/cackey.c:4364: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(&retval[numattrs], &curr_attr, sizeof(curr_attr));
data/cackey-0.7.10/cackey.c:4519: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(identities[id_idx].pcsc_identity, &pcsc_identities[cert_idx], sizeof(*identities[id_idx].pcsc_identity));
data/cackey-0.7.10/cackey.c:4522: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(identities[id_idx].pcsc_identity->certificate, pcsc_identities[cert_idx].certificate, pcsc_identities[cert_idx].certificate_len);
data/cackey-0.7.10/cackey.c:4832: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(pInfo->manufacturerID, manufacturerID, sizeof(manufacturerID) - 1);
data/cackey-0.7.10/cackey.c:4837: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(pInfo->libraryDescription, libraryDescription, sizeof(libraryDescription) - 1);
data/cackey-0.7.10/cackey.c:5185: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(pInfo->manufacturerID, cackey_slots[slotID].pcsc_reader, bytes_to_copy);
data/cackey-0.7.10/cackey.c:5195: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(pInfo->slotDescription, slotDescription, sizeof(slotDescription) - 1);
data/cackey-0.7.10/cackey.c:5277:6:  [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(cackey_slots[slotID].label, pInfo->label, sizeof(pInfo->label));
data/cackey-0.7.10/cackey.c:5297: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(pInfo->label, defaultLabel, sizeof(defaultLabel) - 1);
data/cackey-0.7.10/cackey.c:5301: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(pInfo->manufacturerID, manufacturerID, sizeof(manufacturerID) - 1);
data/cackey-0.7.10/cackey.c:5304: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(pInfo->model, model, sizeof(model) - 1);
data/cackey-0.7.10/cackey.c:5485: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 oldpinbuf[64], newpinbuf[64];
data/cackey-0.7.10/cackey.c:5920: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 pinbuf[64];
data/cackey-0.7.10/cackey.c:6277: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(curr_attr->pValue, pValue, ulValueLen);
data/cackey-0.7.10/cackey.c:6408: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(cackey_sessions[hSession].search_query, pTemplate, ulCount * sizeof(*pTemplate));
data/cackey-0.7.10/cackey.c:6419:6:  [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(cackey_sessions[hSession].search_query[idx].pValue, pTemplate[idx].pValue, pTemplate[idx].ulValueLen);
data/cackey-0.7.10/cackey.c:7064:6:  [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(pPart, buf, buflen);
data/cackey-0.7.10/cackey.c:7499: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(cackey_sessions[hSession].sign_buf + cackey_sessions[hSession].sign_bufused, pPart, ulPartLen);
data/cackey-0.7.10/cackey.c:7617:6:  [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(pSignature, sigbuf, sigbuflen);
data/cackey-0.7.10/md5.c:58:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static unsigned char PADDING[64] = {
data/cackey-0.7.10/md5.c:132: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(&context->buffer[index], input, partLen);
data/cackey-0.7.10/md5.c:146: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(&context->buffer[index], &input[i], inputLen - i);
data/cackey-0.7.10/md5.c:154:31:  [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 void MD5Final(unsigned char digest[16], MD5_CTX *context) {
data/cackey-0.7.10/md5.c:155: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 bits[8];
data/cackey-0.7.10/md5.c:179:55:  [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 void MD5Transform (uint32_t state[4], unsigned char block[64]) {
data/cackey-0.7.10/sha.h:224:14:  [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 k_opad[USHA_Max_Message_Block_Size];
data/cackey-0.7.10/sha.h:239:14:  [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 prk[USHAMaxHashSize];
data/cackey-0.7.10/sha.h:337:53:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern int hkdf(SHAversion whichSha, const unsigned char *salt,
data/cackey-0.7.10/sha.h:338:46:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                int salt_len, const unsigned char *ikm, int ikm_len,
data/cackey-0.7.10/sha.h:339:32:  [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 unsigned char *info, int info_len,
data/cackey-0.7.10/sha.h:341:60:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern int hkdfExtract(SHAversion whichSha, const unsigned char *salt,
data/cackey-0.7.10/sha.h:342:53:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                       int salt_len, const unsigned char *ikm,
data/cackey-0.7.10/sha.h:345:51:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                      int prk_len, const unsigned char *info,
data/cackey-0.7.10/sha.h:361:38:  [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 unsigned char *info, int info_len,
data/cackey-0.7.10/test.c:62: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(mszReaders, readers, *pcchReaders);
data/cackey-0.7.10/test.c:193: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(pbRecvBuffer, inputData, bytesToRead);
data/cackey-0.7.10/test.c:209:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(fileName, O_RDONLY);
data/cackey-0.7.10/test.c:240: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.
	static char retbuf[1024];
data/cackey-0.7.10/test.c:575: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(user_pin, "0000000", 8);
data/cackey-0.7.10/cackey.c:2749:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			memcpy(curr_id->card.piv.label, piv_label, strlen(piv_label) + 1);
data/cackey-0.7.10/cackey.c:3983: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).
					ulValueLen = strlen(pValue);
data/cackey-0.7.10/cackey.c:4585:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(pinbuf) < 1) {
data/cackey-0.7.10/cackey.c:4591: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).
	if (pinbuf[strlen(pinbuf) - 1] == '\n') {
data/cackey-0.7.10/cackey.c:4592: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).
		pinbuf[strlen(pinbuf) - 1] = '\0';
data/cackey-0.7.10/cackey.c:4971: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).
					curr_reader_len = strlen(pcsc_readers);
data/cackey-0.7.10/cackey.c:5181: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).
	bytes_to_copy = strlen(cackey_slots[slotID].pcsc_reader);
data/cackey-0.7.10/cackey.c:5544: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).
		ulOldPinLen = strlen(oldpinbuf);
data/cackey-0.7.10/cackey.c:5558: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).
		ulNewPinLen = strlen(newpinbuf);
data/cackey-0.7.10/cackey.c:6004: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).
		ulPinLen = strlen(pinbuf);
data/cackey-0.7.10/test.c:56: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).
	*pcchReaders = strlen(readers) + 1;
data/cackey-0.7.10/test.c:217:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	read_ret = read(fd, inputData, inputDataLen);
data/cackey-0.7.10/test.c:582:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if (strlen((char *) user_pin) >= 1) {
data/cackey-0.7.10/test.c:583: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).
				while (user_pin[strlen((char *) user_pin) - 1] < ' ') {
data/cackey-0.7.10/test.c:584:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					user_pin[strlen((char *) user_pin) - 1] = '\0';
data/cackey-0.7.10/test.c:588:51:  [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).
			chk_rv = C_Login(hSession, CKU_USER, user_pin, strlen((char *) user_pin));
data/cackey-0.7.10/test.c:775:53:  [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).
				chk_rv = C_Sign(hSession, (CK_BYTE_PTR) "Test", strlen("Test"), (CK_BYTE_PTR) &signature, &signature_len);
data/cackey-0.7.10/test.c:797: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).
				chk_rv = C_Encrypt(hSession, (CK_BYTE_PTR) "Test", strlen("Test"), encrypted_buf, &encrypted_buflen);

ANALYSIS SUMMARY:

Hits = 118
Lines analyzed = 19008 in approximately 0.77 seconds (24828 lines/second)
Physical Source Lines of Code (SLOC) = 10672
Hits@level = [0] 112 [1]  18 [2]  80 [3]  18 [4]   2 [5]   0
Hits@level+ = [0+] 230 [1+] 118 [2+] 100 [3+]  20 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 21.5517 [1+] 11.057 [2+] 9.37031 [3+] 1.87406 [4+] 0.187406 [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.