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/xca-2.3.0/widgets/NewCrl.cpp
Examining data/xca-2.3.0/widgets/KeyTreeView.h
Examining data/xca-2.3.0/widgets/RevocationList.h
Examining data/xca-2.3.0/widgets/OidResolver.h
Examining data/xca-2.3.0/widgets/NewX509.h
Examining data/xca-2.3.0/widgets/clicklabel.cpp
Examining data/xca-2.3.0/widgets/KeyTreeView.cpp
Examining data/xca-2.3.0/widgets/KeyDetail.h
Examining data/xca-2.3.0/widgets/dhgen.h
Examining data/xca-2.3.0/widgets/OpenDb.h
Examining data/xca-2.3.0/widgets/ReqTreeView.h
Examining data/xca-2.3.0/widgets/distname.h
Examining data/xca-2.3.0/widgets/Options.cpp
Examining data/xca-2.3.0/widgets/CertExtend.cpp
Examining data/xca-2.3.0/widgets/validity.h
Examining data/xca-2.3.0/widgets/TempTreeView.h
Examining data/xca-2.3.0/widgets/MainWindow.cpp
Examining data/xca-2.3.0/widgets/X509SuperTreeView.cpp
Examining data/xca-2.3.0/widgets/NewX509_ext.cpp
Examining data/xca-2.3.0/widgets/OpenDb.cpp
Examining data/xca-2.3.0/widgets/XcaTreeView.cpp
Examining data/xca-2.3.0/widgets/CertDetail.h
Examining data/xca-2.3.0/widgets/XcaTreeView.h
Examining data/xca-2.3.0/widgets/distname.cpp
Examining data/xca-2.3.0/widgets/kvView.cpp
Examining data/xca-2.3.0/widgets/ReqTreeView.cpp
Examining data/xca-2.3.0/widgets/CrlDetail.cpp
Examining data/xca-2.3.0/widgets/RevocationList.cpp
Examining data/xca-2.3.0/widgets/XcaProxyModel.h
Examining data/xca-2.3.0/widgets/XcaProxyModel.cpp
Examining data/xca-2.3.0/widgets/XcaWarning.h
Examining data/xca-2.3.0/widgets/SearchPkcs11.cpp
Examining data/xca-2.3.0/widgets/XcaDialog.h
Examining data/xca-2.3.0/widgets/hashBox.cpp
Examining data/xca-2.3.0/widgets/CertDetail.cpp
Examining data/xca-2.3.0/widgets/PwDialog.h
Examining data/xca-2.3.0/widgets/ItemCombo.h
Examining data/xca-2.3.0/widgets/kvView.h
Examining data/xca-2.3.0/widgets/PwDialog.cpp
Examining data/xca-2.3.0/widgets/v3ext.cpp
Examining data/xca-2.3.0/widgets/clicklabel.h
Examining data/xca-2.3.0/widgets/CertExtend.h
Examining data/xca-2.3.0/widgets/CrlDetail.h
Examining data/xca-2.3.0/widgets/validity.cpp
Examining data/xca-2.3.0/widgets/TempTreeView.cpp
Examining data/xca-2.3.0/widgets/Options.h
Examining data/xca-2.3.0/widgets/XcaHeaderView.cpp
Examining data/xca-2.3.0/widgets/KeyDetail.cpp
Examining data/xca-2.3.0/widgets/OidResolver.cpp
Examining data/xca-2.3.0/widgets/ExportDialog.cpp
Examining data/xca-2.3.0/widgets/v3ext.h
Examining data/xca-2.3.0/widgets/MainWindow.h
Examining data/xca-2.3.0/widgets/NewX509.cpp
Examining data/xca-2.3.0/widgets/MW_help.cpp
Examining data/xca-2.3.0/widgets/CertTreeView.cpp
Examining data/xca-2.3.0/widgets/NewCrl.h
Examining data/xca-2.3.0/widgets/FocusCombo.h
Examining data/xca-2.3.0/widgets/NewKey.h
Examining data/xca-2.3.0/widgets/NewKey.cpp
Examining data/xca-2.3.0/widgets/ImportMulti.h
Examining data/xca-2.3.0/widgets/CertTreeView.h
Examining data/xca-2.3.0/widgets/X509SuperTreeView.h
Examining data/xca-2.3.0/widgets/hashBox.h
Examining data/xca-2.3.0/widgets/ImportMulti.cpp
Examining data/xca-2.3.0/widgets/MW_menu.cpp
Examining data/xca-2.3.0/widgets/XcaHeaderView.h
Examining data/xca-2.3.0/widgets/SearchPkcs11.h
Examining data/xca-2.3.0/widgets/ExportDialog.h
Examining data/xca-2.3.0/widgets/MW_database.cpp
Examining data/xca-2.3.0/widgets/database_schema.cpp
Examining data/xca-2.3.0/lib/pki_pkcs12.cpp
Examining data/xca-2.3.0/lib/ipvalidator.h
Examining data/xca-2.3.0/lib/sql.h
Examining data/xca-2.3.0/lib/x509name.cpp
Examining data/xca-2.3.0/lib/db_base.h
Examining data/xca-2.3.0/lib/pki_multi.cpp
Examining data/xca-2.3.0/lib/func.h
Examining data/xca-2.3.0/lib/pki_pkcs7.h
Examining data/xca-2.3.0/lib/main.cpp
Examining data/xca-2.3.0/lib/pki_temp.cpp
Examining data/xca-2.3.0/lib/db_crl.h
Examining data/xca-2.3.0/lib/pki_evp.cpp
Examining data/xca-2.3.0/lib/asn1int.cpp
Examining data/xca-2.3.0/lib/db_x509req.h
Examining data/xca-2.3.0/lib/pki_x509.h
Examining data/xca-2.3.0/lib/db_x509super.cpp
Examining data/xca-2.3.0/lib/db_base.cpp
Examining data/xca-2.3.0/lib/pass_info.h
Examining data/xca-2.3.0/lib/pki_x509.cpp
Examining data/xca-2.3.0/lib/pkcs11.h
Examining data/xca-2.3.0/lib/pki_temp.h
Examining data/xca-2.3.0/lib/load_obj.h
Examining data/xca-2.3.0/lib/x509rev.cpp
Examining data/xca-2.3.0/lib/db_x509.h
Examining data/xca-2.3.0/lib/asn1time.cpp
Examining data/xca-2.3.0/lib/db_key.cpp
Examining data/xca-2.3.0/lib/pk11_attribute.h
Examining data/xca-2.3.0/lib/pki_key.cpp
Examining data/xca-2.3.0/lib/Passwd.h
Examining data/xca-2.3.0/lib/pki_crl.h
Examining data/xca-2.3.0/lib/pki_x509super.cpp
Examining data/xca-2.3.0/lib/openssl_compat.h
Examining data/xca-2.3.0/lib/entropy.cpp
Examining data/xca-2.3.0/lib/db_x509.cpp
Examining data/xca-2.3.0/lib/x509v3ext.cpp
Examining data/xca-2.3.0/lib/pass_info.cpp
Examining data/xca-2.3.0/lib/pki_x509req.h
Examining data/xca-2.3.0/lib/builtin_curves.cpp
Examining data/xca-2.3.0/lib/asn1time.h
Examining data/xca-2.3.0/lib/base.h
Examining data/xca-2.3.0/lib/settings.h
Examining data/xca-2.3.0/lib/pki_scard.h
Examining data/xca-2.3.0/lib/db_token.cpp
Examining data/xca-2.3.0/lib/sql.cpp
Examining data/xca-2.3.0/lib/headerlist.h
Examining data/xca-2.3.0/lib/pkcs11.cpp
Examining data/xca-2.3.0/lib/db_x509req.cpp
Examining data/xca-2.3.0/lib/db_x509super.h
Examining data/xca-2.3.0/lib/main.h
Examining data/xca-2.3.0/lib/Passwd.cpp
Examining data/xca-2.3.0/lib/pki_x509req.cpp
Examining data/xca-2.3.0/lib/oid.h
Examining data/xca-2.3.0/lib/db.cpp
Examining data/xca-2.3.0/lib/pki_pkcs7.cpp
Examining data/xca-2.3.0/lib/db_temp.h
Examining data/xca-2.3.0/lib/pki_base.cpp
Examining data/xca-2.3.0/lib/db.h
Examining data/xca-2.3.0/lib/pki_multi.h
Examining data/xca-2.3.0/lib/xfile.h
Examining data/xca-2.3.0/lib/pkcs11_lib.h
Examining data/xca-2.3.0/lib/load_obj.cpp
Examining data/xca-2.3.0/lib/db_temp.cpp
Examining data/xca-2.3.0/lib/x509name.h
Examining data/xca-2.3.0/lib/entropy.h
Examining data/xca-2.3.0/lib/pki_base.h
Examining data/xca-2.3.0/lib/version.cpp
Examining data/xca-2.3.0/lib/opensc-pkcs11.h
Examining data/xca-2.3.0/lib/pki_key.h
Examining data/xca-2.3.0/lib/pki_evp.h
Examining data/xca-2.3.0/lib/pki_pkcs12.h
Examining data/xca-2.3.0/lib/db_token.h
Examining data/xca-2.3.0/lib/pki_scard.cpp
Examining data/xca-2.3.0/lib/func.cpp
Examining data/xca-2.3.0/lib/asn1int.h
Examining data/xca-2.3.0/lib/pki_x509super.h
Examining data/xca-2.3.0/lib/db_key.h
Examining data/xca-2.3.0/lib/x509rev.h
Examining data/xca-2.3.0/lib/pki_crl.cpp
Examining data/xca-2.3.0/lib/exception.h
Examining data/xca-2.3.0/lib/settings.cpp
Examining data/xca-2.3.0/lib/db_crl.cpp
Examining data/xca-2.3.0/lib/builtin_curves.h
Examining data/xca-2.3.0/lib/pkcs11_lib.cpp
Examining data/xca-2.3.0/lib/pk11_attribute.cpp
Examining data/xca-2.3.0/lib/oid.cpp
Examining data/xca-2.3.0/lib/x509v3ext.h

FINAL RESULTS:

data/xca-2.3.0/lib/main.cpp:29:42:  [4] (shell) system:
  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.
QLocale XCA_application::lang = QLocale::system();
data/xca-2.3.0/lib/main.cpp:61:24:  [4] (shell) system:
  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.
	langAvail << QLocale::system();
data/xca-2.3.0/lib/main.cpp:147:23:  [4] (shell) system:
  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.
	if (lang == QLocale::system()) {
data/xca-2.3.0/lib/main.cpp:279:2:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	fprintf(stderr, YELL "% 4d.%02d %s:" RESET " %s\n",
data/xca-2.3.0/widgets/MW_help.cpp:56:2:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	fprintf(stderr, XCA_TITLE " Version %s\n", version_str(false));
data/xca-2.3.0/widgets/MW_help.cpp:62:2:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	fprintf(stderr, XCA_TITLE " Version %s\n"
data/xca-2.3.0/widgets/MW_menu.cpp:34:21:  [4] (shell) system:
  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.
		locale = QLocale::system();
data/xca-2.3.0/lib/func.cpp:117:19:  [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.
		const char *p = getenv("XCA_PORTABLE");
data/xca-2.3.0/lib/main.cpp:256:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		char *d = getenv("XCA_DEBUG");
data/xca-2.3.0/widgets/OpenDb.cpp:219:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	const char *opts = getenv(envvar.toLatin1());
data/xca-2.3.0/lib/db.cpp:32:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!file.open(QIODevice::ReadWrite)) {
data/xca-2.3.0/lib/db.cpp:65: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(h->name, head.name, NAMELEN);
data/xca-2.3.0/lib/db.cpp:246:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[BUFSIZ];
data/xca-2.3.0/lib/db.cpp:249:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!this_file.open(QIODevice::ReadOnly)) {
data/xca-2.3.0/lib/db.cpp:253:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!new_file.open(QIODevice::ReadWrite)) {
data/xca-2.3.0/lib/db.cpp:282: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(&ret, ba.constData(), sizeof(uint32_t));
data/xca-2.3.0/lib/db.h:43: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 name[NAMELEN];	/* name of the entry */
data/xca-2.3.0/lib/db_x509.cpp:309: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 buf[SHA512_DIGEST_LENGTH];
data/xca-2.3.0/lib/db_x509.cpp:310: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 md[SHA512_DIGEST_LENGTH];
data/xca-2.3.0/lib/entropy.cpp:107:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[256];
data/xca-2.3.0/lib/entropy.cpp:175: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 buf[RAND_BUF_SIZE];
data/xca-2.3.0/lib/entropy.h:20:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static unsigned char pool[512];
data/xca-2.3.0/lib/func.cpp:73:2:  [2] (buffer) wchar_t:
  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.
	wchar_t inst_dir[2048];
data/xca-2.3.0/lib/func.cpp:87:2:  [2] (buffer) wchar_t:
  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.
	wchar_t inst_dir[2048] = L"";
data/xca-2.3.0/lib/func.cpp:170:2:  [2] (buffer) TCHAR:
  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.
	TCHAR buf[255] = "";
data/xca-2.3.0/lib/func.cpp:218: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).
	if (f.open(QIODevice::ReadOnly)) {
data/xca-2.3.0/lib/func.cpp:316: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 guid[100] = "", md[SHA_DIGEST_LENGTH];
data/xca-2.3.0/lib/func.cpp:359:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		if (file.open(QIODevice::ReadOnly)) {
data/xca-2.3.0/lib/func.cpp:371: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((char*)guid, "%ld", gethostid());
data/xca-2.3.0/lib/func.cpp:480:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[512];
data/xca-2.3.0/lib/func.cpp:563: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 m[EVP_MAX_MD_SIZE];
data/xca-2.3.0/lib/ipvalidator.h:31:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char buf[sizeof(struct in6_addr)];
data/xca-2.3.0/lib/main.cpp:57:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (file.open(QIODevice::ReadOnly)) {
data/xca-2.3.0/lib/main.cpp:152:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (file.open(QIODevice::WriteOnly)) {
data/xca-2.3.0/lib/main.cpp:222:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char segv_data[1024];
data/xca-2.3.0/lib/main.h:18:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char segv_data[1024];
data/xca-2.3.0/lib/oid.cpp:127:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!file.open(QIODevice::ReadOnly))
data/xca-2.3.0/lib/oid.cpp:148:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!file.open(QIODevice::ReadOnly))
data/xca-2.3.0/lib/opensc-pkcs11.h:198: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 manufacturer_id[32];
data/xca-2.3.0/lib/opensc-pkcs11.h:200: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 library_description[32];
data/xca-2.3.0/lib/opensc-pkcs11.h:215: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 slot_description[64];
data/xca-2.3.0/lib/opensc-pkcs11.h:216: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 manufacturer_id[32];
data/xca-2.3.0/lib/opensc-pkcs11.h:231: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 label[32];
data/xca-2.3.0/lib/opensc-pkcs11.h:232: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 manufacturer_id[32];
data/xca-2.3.0/lib/opensc-pkcs11.h:233: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 model[16];
data/xca-2.3.0/lib/opensc-pkcs11.h:234: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 serial_number[16];
data/xca-2.3.0/lib/opensc-pkcs11.h:248: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 utc_time[16];
data/xca-2.3.0/lib/opensc-pkcs11.h:477: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 year[4];
data/xca-2.3.0/lib/opensc-pkcs11.h:478: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 month[2];
data/xca-2.3.0/lib/opensc-pkcs11.h:479: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 day[2];
data/xca-2.3.0/lib/pk11_attribute.cpp:53: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(attr.pValue, ptr, len);
data/xca-2.3.0/lib/pk11_attribute.cpp:93: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(attributes, a.attributes, attlen *sizeof(*attributes));
data/xca-2.3.0/lib/pk11_attribute.cpp:98: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(p, a.attributes[i].pValue, attributes[i].ulValueLen);
data/xca-2.3.0/lib/pk11_attribute.cpp:133: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(attr->pValue, a.attr.pValue, attr->ulValueLen);
data/xca-2.3.0/lib/pkcs11.cpp:368: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 clabel[32];
data/xca-2.3.0/lib/pkcs11.cpp:371: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(clabel, ba.constData(), ba.size());
data/xca-2.3.0/lib/pkcs11.cpp:437:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		unsigned char buf[ID_LEN];
data/xca-2.3.0/lib/pkcs11.cpp:676: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 rs_buf[128];
data/xca-2.3.0/lib/pkcs11.cpp:720: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 rs_buf[512];
data/xca-2.3.0/lib/pkcs11.cpp:1043: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 rs_buf[128];
data/xca-2.3.0/lib/pkcs11.cpp:1082: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 rs_buf[512];
data/xca-2.3.0/lib/pkcs11_lib.cpp:35:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			fd = open(fn, O_RDONLY);
data/xca-2.3.0/lib/pki_base.cpp:355: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 md[EVP_MAX_MD_SIZE];
data/xca-2.3.0/lib/pki_evp.cpp:482: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 iv[EVP_MAX_IV_LENGTH];
data/xca-2.3.0/lib/pki_evp.cpp:483: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 ckey[EVP_MAX_KEY_LENGTH];
data/xca-2.3.0/lib/pki_evp.cpp:497: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(iv, myencKey.constData(), 8); /* recover the iv */
data/xca-2.3.0/lib/pki_evp.cpp:803: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 md[32], sig[1024];
data/xca-2.3.0/lib/pki_key.cpp:409: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 zs[10];
data/xca-2.3.0/lib/pki_key.cpp:415: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(zs, "%02X%c",buf[j], ((j+1)%16 == 0) ? '\n' :
data/xca-2.3.0/lib/pki_key.cpp:638: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 p[4];
data/xca-2.3.0/lib/pki_temp.cpp:347:6:  [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).
	buf.open(QIODevice::WriteOnly | QIODevice::Append);
data/xca-2.3.0/lib/pki_temp.cpp:359:6:  [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).
	buf.open(QIODevice::ReadOnly);
data/xca-2.3.0/lib/pki_temp.cpp:462: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).
		file.open(QIODevice::ReadOnly | QIODevice::QIODevice::Text);
data/xca-2.3.0/lib/pki_x509.cpp:266: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 digest[EVP_MAX_MD_SIZE];
data/xca-2.3.0/lib/xfile.h:27: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).
		bool open(OpenMode flags)
data/xca-2.3.0/lib/xfile.h:29:20:  [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).
			bool o = QFile::open(flags | Unbuffered);
data/xca-2.3.0/lib/xfile.h:93:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			return open(ReadWrite | Truncate);
data/xca-2.3.0/lib/xfile.h:97:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			return open(ReadOnly);
data/xca-2.3.0/widgets/MW_database.cpp:118: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 head[4];
data/xca-2.3.0/widgets/MW_database.cpp:121:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!file.open(QIODevice::ReadOnly))
data/xca-2.3.0/widgets/MW_database.cpp:456:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!inputFile.open(QIODevice::ReadOnly))
data/xca-2.3.0/widgets/MW_database.cpp:459:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[2048];
data/xca-2.3.0/widgets/MW_database.cpp:481:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (file.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
data/xca-2.3.0/widgets/MW_database.cpp:563:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!file.open(QIODevice::ReadOnly))
data/xca-2.3.0/widgets/MW_database.cpp:568: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 buf[1024];
data/xca-2.3.0/widgets/MW_database.cpp:609:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!file.open(QIODevice::ReadWrite))
data/xca-2.3.0/widgets/MainWindow.cpp:562: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 rand[8];
data/xca-2.3.0/widgets/OpenDb.cpp:63:15:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static const char * const names[NUM_PARAM] =
data/xca-2.3.0/widgets/OpenDb.cpp:167:6:  [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).
			f.open(QIODevice::WriteOnly);
data/xca-2.3.0/widgets/OpenDb.cpp:175: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).
				f.open(QIODevice::ReadOnly);
data/xca-2.3.0/widgets/OpenDb.cpp:225:5:  [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).
	db.open();
data/xca-2.3.0/widgets/PwDialog.cpp:58: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(buf, pw.constData(), size);
data/xca-2.3.0/widgets/SearchPkcs11.cpp:154:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (qf.open(QIODevice::ReadOnly)) {
data/xca-2.3.0/lib/db.cpp:106:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = file.read((char*)&head, sizeof(db_header_t) );
data/xca-2.3.0/lib/db.cpp:135:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = file.read((char*)&head, sizeof head);
data/xca-2.3.0/lib/db.cpp:213:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = file.read((char*)data, size);
data/xca-2.3.0/lib/db.cpp:258:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = this_file.read(buf, sizeof buf);
data/xca-2.3.0/lib/entropy.cpp:127:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		int len = read(fd, buf, amount > sizeof buf ?
data/xca-2.3.0/lib/func.cpp:374: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).
	SHA1(guid, strlen((char*)guid), md);
data/xca-2.3.0/lib/main.cpp:58:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		lang = QLocale(QString(file.read(128)));
data/xca-2.3.0/lib/pki_evp.cpp:739:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(buf, pki_evp::passwd, size);
data/xca-2.3.0/lib/pki_evp.cpp:740:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	return strlen(pki_evp::passwd);
data/xca-2.3.0/lib/pki_key.cpp:572:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ba = file.read(4096);
data/xca-2.3.0/lib/pki_temp.cpp:444:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		QByteArray ba = file.read(4096*1024);
data/xca-2.3.0/lib/xfile.h:86:15:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			mode_t m = umask(077);
data/xca-2.3.0/lib/xfile.h:88:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
			umask(m);
data/xca-2.3.0/widgets/MW_database.cpp:123:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	file.read(head, sizeof head);
data/xca-2.3.0/widgets/OpenDb.cpp:176:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				QByteArray ba = f.read(6);

ANALYSIS SUMMARY:

Hits = 108
Lines analyzed = 32001 in approximately 0.64 seconds (49892 lines/second)
Physical Source Lines of Code (SLOC) = 26886
Hits@level = [0]   5 [1]  15 [2]  83 [3]   3 [4]   7 [5]   0
Hits@level+ = [0+] 113 [1+] 108 [2+]  93 [3+]  10 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 4.20293 [1+] 4.01696 [2+] 3.45905 [3+] 0.371941 [4+] 0.260359 [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.