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/libqalculate-3.3.0/libqalculate/Number.cc
Examining data/libqalculate-3.3.0/libqalculate/Number.h
Examining data/libqalculate-3.3.0/libqalculate/QalculateDateTime.cc
Examining data/libqalculate-3.3.0/libqalculate/Variable.h
Examining data/libqalculate-3.3.0/libqalculate/MathStructure.cc
Examining data/libqalculate-3.3.0/libqalculate/ExpressionItem.h
Examining data/libqalculate-3.3.0/libqalculate/Unit.h
Examining data/libqalculate-3.3.0/libqalculate/Calculator.h
Examining data/libqalculate-3.3.0/libqalculate/qalculate.h
Examining data/libqalculate-3.3.0/libqalculate/BuiltinFunctions.cc
Examining data/libqalculate-3.3.0/libqalculate/Calculator.cc
Examining data/libqalculate-3.3.0/libqalculate/DataSet.cc
Examining data/libqalculate-3.3.0/libqalculate/Variable.cc
Examining data/libqalculate-3.3.0/libqalculate/MathStructure.h
Examining data/libqalculate-3.3.0/libqalculate/includes.h
Examining data/libqalculate-3.3.0/libqalculate/Unit.cc
Examining data/libqalculate-3.3.0/libqalculate/util.h
Examining data/libqalculate-3.3.0/libqalculate/util.cc
Examining data/libqalculate-3.3.0/libqalculate/QalculateDateTime.h
Examining data/libqalculate-3.3.0/libqalculate/BuiltinFunctions.h
Examining data/libqalculate-3.3.0/libqalculate/Function.cc
Examining data/libqalculate-3.3.0/libqalculate/Prefix.h
Examining data/libqalculate-3.3.0/libqalculate/support.h
Examining data/libqalculate-3.3.0/libqalculate/Prefix.cc
Examining data/libqalculate-3.3.0/libqalculate/Function.h
Examining data/libqalculate-3.3.0/libqalculate/ExpressionItem.cc
Examining data/libqalculate-3.3.0/libqalculate/DataSet.h
Examining data/libqalculate-3.3.0/src/qalc.cc
Examining data/libqalculate-3.3.0/src/defs2doc.cc
Examining data/libqalculate-3.3.0/src/test.cc

FINAL RESULTS:

data/libqalculate-3.3.0/libqalculate/Calculator.cc:10464:12:  [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(!u->system().empty()) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:10465:72:  [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.
					xmlNewTextChild(newnode, NULL, (xmlChar*) "system", (xmlChar*) u->system().c_str());
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11771:15:  [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.
	FILE *pipe = popen("gnuplot - 2>/dev/null", "w");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:12254: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.
		pipe = popen(commandline.c_str(), "w");
data/libqalculate-3.3.0/libqalculate/Unit.cc:75:29:  [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.
		ssystem = ((Unit*) item)->system();
data/libqalculate-3.3.0/libqalculate/Unit.cc:106: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.
const string &Unit::system() const {
data/libqalculate-3.3.0/libqalculate/Unit.h:73:16:  [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.
	const string &system() const;	
data/libqalculate-3.3.0/src/qalc.cc:337:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(cstr, matches[index]->c_str());
data/libqalculate-3.3.0/libqalculate/Calculator.cc:370:2:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	srand(time(NULL));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:589:2:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	srand(time(NULL));
data/libqalculate-3.3.0/libqalculate/util.cc:439:17:  [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 ((homedir = getenv("HOME")) == NULL) {
data/libqalculate-3.3.0/libqalculate/util.cc:462:16:  [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((homedir = getenv("XDG_CONFIG_HOME")) == NULL) {
data/libqalculate-3.3.0/libqalculate/util.cc:485:16:  [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((homedir = getenv("XDG_DATA_HOME")) == NULL) {
data/libqalculate-3.3.0/libqalculate/util.cc:510:16:  [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((homedir = getenv("XDG_CACHE_HOME")) == NULL) {
data/libqalculate-3.3.0/libqalculate/util.h:30:18:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
	#define srand48 srand
data/libqalculate-3.3.0/libqalculate/Calculator.cc:1696: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 s_uptime[100];
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4821:44:  [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.
bool Calculator::variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4839:44:  [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.
bool Calculator::functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4857:40:  [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.
bool Calculator::unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:10955:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	FILE *file = fopen(file_name, "r");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:10962: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 line[10000];
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11026:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	FILE *file = fopen(file_name, "r");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11048: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 line[10000];
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11174:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	FILE *file = fopen(file_name, "w+");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11446: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(filename.c_str());
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11622: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 error_buffer[CURL_ERROR_SIZE];
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11637: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11768:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char filename[MAX_PATH]; 
data/libqalculate-3.3.0/libqalculate/Calculator.cc:12139:18:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			FILE *fdata = fopen(filepath.c_str(), "w+");
data/libqalculate-3.3.0/libqalculate/Calculator.h:225: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 vbuffer[200];
data/libqalculate-3.3.0/libqalculate/Calculator.h:918:33:  [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.
	bool variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs);
data/libqalculate-3.3.0/libqalculate/Calculator.h:923:33:  [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.
	bool functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs);
data/libqalculate-3.3.0/libqalculate/Calculator.h:928:29:  [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.
	bool unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs);
data/libqalculate-3.3.0/libqalculate/QalculateDateTime.cc:202: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[10];
data/libqalculate-3.3.0/libqalculate/QalculateDateTime.cc:379: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 tzstr[10] = "";
data/libqalculate-3.3.0/libqalculate/QalculateDateTime.cc:556: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[100];
data/libqalculate-3.3.0/libqalculate/util.cc:57: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 buffer[20000];
data/libqalculate-3.3.0/libqalculate/util.cc:142:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(buffer, "%.*G", precision, value);
data/libqalculate-3.3.0/libqalculate/util.cc:149:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(buffer, "%p", o);
data/libqalculate-3.3.0/libqalculate/util.cc:154:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(buffer, "%li", value);
data/libqalculate-3.3.0/libqalculate/util.cc:433: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 path[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:448: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:455:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char path[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:471: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:478: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 path[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:494: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:501: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 path[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:557: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:576: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:606: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/libqalculate/util.cc:664: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 tmp[256];
data/libqalculate-3.3.0/libqalculate/util.cc:752: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 error_buffer[CURL_ERROR_SIZE];
data/libqalculate-3.3.0/libqalculate/util.cc:766: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 exepath[MAX_PATH];
data/libqalculate-3.3.0/src/defs2doc.cc:27: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 buffer[1000];
data/libqalculate-3.3.0/src/defs2doc.cc:569:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	ffile = fopen("appendixa.xml", "w+");
data/libqalculate-3.3.0/src/defs2doc.cc:570:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	vfile = fopen("appendixb.xml", "w+");
data/libqalculate-3.3.0/src/defs2doc.cc:571:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	ufile = fopen("appendixc.xml", "w+");
data/libqalculate-3.3.0/src/qalc.cc:78:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char buffer[1000];
data/libqalculate-3.3.0/src/qalc.cc:532: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[1000];
data/libqalculate-3.3.0/src/qalc.cc:1608:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	FILE *file = fopen(filename.c_str(), "r");
data/libqalculate-3.3.0/src/qalc.cc:1609: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 line[10000];
data/libqalculate-3.3.0/src/qalc.cc:1902:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
			cfile = fopen(command_file.c_str(), "r");
data/libqalculate-3.3.0/src/qalc.cc:5269:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	file = fopen(filename.c_str(), "r");
data/libqalculate-3.3.0/src/qalc.cc:5273:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		file = fopen(oldfilename.c_str(), "r");
data/libqalculate-3.3.0/src/qalc.cc:5303:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char line[10000];
data/libqalculate-3.3.0/src/qalc.cc:5568:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	file = fopen(filename.c_str(), "w+");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:94:448:  [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).
#define XML_GET_LOCALE_STRING_FROM_TEXT(node, str, best, next_best)		value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); lang = xmlNodeGetLang(node); if(!best) {if(!lang) {if(!next_best) {if(value) {str = (char*) value; remove_blank_ends(str);} else str = ""; if(locale.empty()) {best = true;}}} else {if(locale == (char*) lang) {best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {next_best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && str.empty() && value) {str = (char*) value; remove_blank_ends(str);}}} if(value) xmlFree(value); if(lang) xmlFree(lang);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:95:452:  [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).
#define XML_GET_LOCALE_STRING_FROM_TEXT_REQ(node, str, best, next_best)		value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); lang = xmlNodeGetLang(node); if(!best) {if(!lang) {if(!next_best) {if(value) {str = (char*) value; remove_blank_ends(str);} else str = ""; if(locale.empty()) {best = true;}}} else {if(locale == (char*) lang) {best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {next_best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && str.empty() && value && !require_translation) {str = (char*) value; remove_blank_ends(str);}}} if(value) xmlFree(value); if(lang) xmlFree(lang);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:258:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if(!read<bool>(&b_parse)) break;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:260:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if(!read<void *>(&x) || !x) break;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2102:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					i += strlen(str);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2289: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).
				str.replace(ui, strlen(COMMA), b_alt_comma ? ";" : COMMA_STR);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2306: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).
				str.replace(ui, strlen(DOT), DOT_STR);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2345:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					str.replace(ui, strlen(DOT), SPACE);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2346:30:  [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).
					ui = str.find(DOT, ui + strlen(SPACE));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2362:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				ui = str.find(DOT_STR, ui + strlen(DOT));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2380:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					str.erase(ui, strlen(COMMA));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2397:55:  [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).
				ui = str.find(b_alt_comma ? ";" : COMMA_STR, ui + strlen(COMMA));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:2921: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).
				to_str.erase(0, strlen(SIGN_MINUS));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3113:92:  [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(allow_empty_from && (str.find("to ") == 0 || (str.find(_("to")) == 0 && str.length() > strlen(_("to")) && str[strlen(_("to"))] == ' '))) return true;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3113:115:  [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(allow_empty_from && (str.find("to ") == 0 || (str.find(_("to")) == 0 && str.length() > strlen(_("to")) && str[strlen(_("to"))] == ' '))) return true;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3120: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).
		size_t l = strlen(_(" to "));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3123: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).
		size_t l = strlen(" to ");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3128:74:  [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).
	} else if(allow_empty_from && (str.find(_("to")) == 0 && str.length() > strlen(_("to")) && str[strlen(_("to"))] == ' ')) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3128:97:  [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).
	} else if(allow_empty_from && (str.find(_("to")) == 0 && str.length() > strlen(_("to")) && str[strlen(_("to"))] == ' ')) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3129:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		to_str = str.substr(strlen(_("to")));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:3137:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			to_str.replace(0, strlen(SIGN_MINUS), MINUS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4789:5:  [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(name_) == 0) return false;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4797:5:  [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(name_) == 0) return false;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4805:5:  [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(name_) == 0) return false;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4822:5:  [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(name_) == 0) return false;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4840:5:  [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(name_) == 0) return false;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:4858:5:  [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(name_) == 0) return false;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5268: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).
					int index_shift = strlen(internal_signs[i + 1]) - strlen(internal_signs[i]);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5268: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).
					int index_shift = strlen(internal_signs[i + 1]) - strlen(internal_signs[i]);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5275:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					str.replace(ui, strlen(internal_signs[i]), internal_signs[i + 1]);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5276:44:  [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).
					ui = str.find(internal_signs[i], ui + strlen(internal_signs[i + 1]));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5325:59:  [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(i_degree != string::npos && i_degree < str.length() - strlen(SIGN_DEGREE) && is_not_in(NOT_IN_NAMES INTERNAL_OPERATORS NUMBER_ELEMENTS, str[i_degree + strlen(SIGN_DEGREE)])) i_degree = string::npos;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5325:156:  [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(i_degree != string::npos && i_degree < str.length() - strlen(SIGN_DEGREE) && is_not_in(NOT_IN_NAMES INTERNAL_OPERATORS NUMBER_ELEMENTS, str[i_degree + strlen(SIGN_DEGREE)])) i_degree = string::npos;
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5452:60:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					size_t i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5454:54:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
						i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5475:25:  [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).
						str.replace(i_op, strlen("″"), "arcsec" RIGHT_PARENTHESIS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5476:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
						str.replace(i_degree, strlen(SIGN_DEGREE), "deg" PLUS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5482:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				if(str.length() >= i_dquote + strlen("″") && is_in(NUMBERS, str[i_dquote + strlen("″")])) str.insert(i_dquote + strlen("″"), " ");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5482:80:  [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(str.length() >= i_dquote + strlen("″") && is_in(NUMBERS, str[i_dquote + strlen("″")])) str.insert(i_dquote + strlen("″"), " ");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5482:117:  [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(str.length() >= i_dquote + strlen("″") && is_in(NUMBERS, str[i_dquote + strlen("″")])) str.insert(i_dquote + strlen("″"), " ");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5483:27:  [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).
				str.replace(i_dquote, strlen("″"), b_degree ? "arcsec" : "in");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5491:60:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					size_t i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5493:54:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
						i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5517:62:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
							size_t i_op2 = str.find_first_not_of(SPACE, i_quote + strlen("′"));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5521:31:  [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).
								str.replace(i_dquote, strlen("″"), "arcsec" RIGHT_PARENTHESIS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5525:28:  [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).
						str.replace(i_quote, strlen("′"), i_op == i_quote ? "arcmin" RIGHT_PARENTHESIS : "arcmin" PLUS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5526:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
						str.replace(i_degree, strlen(SIGN_DEGREE), "deg" PLUS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5532: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).
				i_op = str.find_first_not_of(SPACE, i_quote + strlen("′"));
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5552:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					else str.replace(i_op + 1, strlen("″"), b_degree ? "arcsec" RIGHT_PARENTHESIS : "in" RIGHT_PARENTHESIS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5553:27:  [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).
					str.replace(i_quote, strlen("′"), b_degree ? "arcmin" PLUS : "ft" PLUS);
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5557:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					if(str.length() >= i_quote + strlen("′") && is_in(NUMBERS, str[i_quote + strlen("′")])) str.insert(i_quote + strlen("′"), " ");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5557:79:  [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(str.length() >= i_quote + strlen("′") && is_in(NUMBERS, str[i_quote + strlen("′")])) str.insert(i_quote + strlen("′"), " ");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5557:115:  [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(str.length() >= i_quote + strlen("′") && is_in(NUMBERS, str[i_quote + strlen("′")])) str.insert(i_quote + strlen("′"), " ");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:5558:27:  [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).
					str.replace(i_quote, strlen("′"), b_degree ? "arcmin" : "ft");
data/libqalculate-3.3.0/libqalculate/Calculator.cc:8364: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).
										} else if(!nextbest_name[name_index] && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {\
data/libqalculate-3.3.0/libqalculate/Calculator.cc:8452:44:  [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).
							} else if(nextbest_names.empty() && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {\
data/libqalculate-3.3.0/libqalculate/Calculator.cc:9032: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).
												} else if(!nextbest_name[name_index] && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:9069: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).
									} else if(nextbest_prop_names.empty() && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:10007: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).
								} else if(strlen((char*) lang) >= 2 && lang[0] == localebase[0] && lang[1] == localebase[1]) {
data/libqalculate-3.3.0/libqalculate/Calculator.cc:11650: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(error_buffer)) error(true, _("Failed to download exchange rates from %s: %s."), "ECB", error_buffer, NULL);
data/libqalculate-3.3.0/libqalculate/DataSet.cc:683:57:  [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).
									} else if((ils < 0 || lang_status[ils] < 1) && strlen((char*) lang) >= 2 && lang[0] == localebase[0] && lang[1] == localebase[1]) {
data/libqalculate-3.3.0/libqalculate/Number.cc:139:194:  [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(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) ("↊", po.can_display_unicode_string_arg))) {cl_str.replace(i, 1, "↊"); i += strlen("↊") - 1;}
data/libqalculate-3.3.0/libqalculate/Number.cc:142:194:  [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(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) ("↋", po.can_display_unicode_string_arg))) {cl_str.replace(i, 1, "↋"); i += strlen("↋") - 1;}
data/libqalculate-3.3.0/libqalculate/Number.cc:259:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	freefunc(tmp, strlen(tmp) + 1);
data/libqalculate-3.3.0/libqalculate/Number.cc:491:64:  [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).
		number = number.substr(pm_index + (number[pm_index] == '+' ? strlen("+/-") : strlen(SIGN_PLUSMINUS)));
data/libqalculate-3.3.0/libqalculate/Number.cc:491:80:  [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).
		number = number.substr(pm_index + (number[pm_index] == '+' ? strlen("+/-") : strlen(SIGN_PLUSMINUS)));
data/libqalculate-3.3.0/libqalculate/QalculateDateTime.cc:380:6:  [1] (buffer) sscanf:
  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.
		if(sscanf(time_str.c_str(), "%2u:%2u:%2u%9s", &newhour, &newmin, &newsec, tzstr) < 3) {
data/libqalculate-3.3.0/libqalculate/QalculateDateTime.cc:381:7:  [1] (buffer) sscanf:
  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.
			if(sscanf(time_str.c_str(), "%2u:%2u%9s", &newhour, &newmin, tzstr) < 2) {
data/libqalculate-3.3.0/libqalculate/QalculateDateTime.cc:382:8:  [1] (buffer) sscanf:
  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.
				if(sscanf(time_str.c_str(), "%2u%2u%2u%9s", &newhour, &newmin, &newsec, tzstr) < 2) {
data/libqalculate-3.3.0/libqalculate/util.cc:68:2:  [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(milliseconds * 1000);
data/libqalculate-3.3.0/libqalculate/util.cc:91: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).
		str.replace(i, strlen(pattern), string(sub));
data/libqalculate-3.3.0/libqalculate/util.cc:92:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		i = str.find(pattern, i + strlen(sub));
data/libqalculate-3.3.0/libqalculate/util.cc:239: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).
	for(size_t i = 0; i < strlen(str); i++) {
data/libqalculate-3.3.0/libqalculate/util.cc:246: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).
	for(size_t i = 0; i < strlen(str); i++) {
data/libqalculate-3.3.0/libqalculate/util.cc:302: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).
	size_t l = strlen(str), l2 = 0;
data/libqalculate-3.3.0/libqalculate/util.cc:367: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).
	if(str1.empty() || strlen(str2) == 0) return false;
data/libqalculate-3.3.0/libqalculate/util.cc:368: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).
	for(size_t i1 = 0, i2 = 0; i1 < str1.length() || i2 < strlen(str2); i1++, i2++) {
data/libqalculate-3.3.0/libqalculate/util.cc:369:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		if(i1 >= str1.length() || i2 >= strlen(str2)) return false;
data/libqalculate-3.3.0/libqalculate/util.cc:370:76:  [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((str1[i1] < 0 && i1 + 1 < str1.length()) || (str2[i2] < 0 && i2 + 1 < strlen(str2))) {
data/libqalculate-3.3.0/libqalculate/util.cc:378:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				while(iu2 + i2 < strlen(str2) && str2[i2 + iu2] < 0) {
data/libqalculate-3.3.0/libqalculate/util.cc:668: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).
	len = strlen(tmp);
data/libqalculate-3.3.0/libqalculate/util.cc:692:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t inlength = strlen(str);
data/libqalculate-3.3.0/libqalculate/util.cc:707:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t inlength = strlen(str);
data/libqalculate-3.3.0/libqalculate/util.cc:723:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t inlength = l <= 0 ? strlen(str) : (size_t) l;
data/libqalculate-3.3.0/libqalculate/util.cc:782:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t i2 = sbuffer.find('\n', i + strlen(version_id) + 1);
data/libqalculate-3.3.0/libqalculate/util.cc:784: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).
	if(i2 == string::npos) s_version = sbuffer.substr(i + strlen(version_id) + 1);
data/libqalculate-3.3.0/libqalculate/util.cc:785:38:  [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).
	else s_version = sbuffer.substr(i + strlen(version_id) + 1, i2 - (i + strlen(version_id) + 1));
data/libqalculate-3.3.0/libqalculate/util.cc:785:72:  [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).
	else s_version = sbuffer.substr(i + strlen(version_id) + 1, i2 - (i + strlen(version_id) + 1));
data/libqalculate-3.3.0/libqalculate/util.h:132:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	template <class T> T read() {
data/libqalculate-3.3.0/libqalculate/util.h:143:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	template <class T> bool read(T *data) {
data/libqalculate-3.3.0/src/qalc.cc:109: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).
	for(int i = strlen(str) - 1; i >= 0; i--) {
data/libqalculate-3.3.0/src/qalc.cc:157:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if(str1.length() < 1 || strlen(str2) < 1) return false;
data/libqalculate-3.3.0/src/qalc.cc:158:59:  [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((str1[0] < 0 && str1.length() > 1) || (str2[0] < 0 && strlen(str2) > 1)) {
data/libqalculate-3.3.0/src/qalc.cc:166:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			while(iu2 < strlen(str2) && str2[iu2] < 0) {
data/libqalculate-3.3.0/src/qalc.cc:261: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(text) < 1) return NULL;
data/libqalculate-3.3.0/src/qalc.cc:264: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).
		size_t l = strlen(text);
data/libqalculate-3.3.0/src/qalc.cc:379: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).
	int l = strlen(str);
data/libqalculate-3.3.0/src/qalc.cc:446:63:  [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(i > result_start && b_or == 1 && str.length() > i + strlen("or") + 2 && str.substr(i + 1, strlen(_("or"))) == _("or") && str[i + strlen(_("or")) + 1] == ' ') or_point = i + strlen(_("or")) + 1;
data/libqalculate-3.3.0/src/qalc.cc:446:101:  [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(i > result_start && b_or == 1 && str.length() > i + strlen("or") + 2 && str.substr(i + 1, strlen(_("or"))) == _("or") && str[i + strlen(_("or")) + 1] == ' ') or_point = i + strlen(_("or")) + 1;
data/libqalculate-3.3.0/src/qalc.cc:446:140:  [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(i > result_start && b_or == 1 && str.length() > i + strlen("or") + 2 && str.substr(i + 1, strlen(_("or"))) == _("or") && str[i + strlen(_("or")) + 1] == ' ') or_point = i + strlen(_("or")) + 1;
data/libqalculate-3.3.0/src/qalc.cc:446:184:  [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(i > result_start && b_or == 1 && str.length() > i + strlen("or") + 2 && str.substr(i + 1, strlen(_("or"))) == _("or") && str[i + strlen(_("or")) + 1] == ' ') or_point = i + strlen(_("or")) + 1;
data/libqalculate-3.3.0/src/qalc.cc:1742:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') {
data/libqalculate-3.3.0/src/qalc.cc:1749:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') {
data/libqalculate-3.3.0/src/qalc.cc:1756:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') {
data/libqalculate-3.3.0/src/qalc.cc:1763:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') {
data/libqalculate-3.3.0/src/qalc.cc:2123:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					size_t l = name.length() + strlen(_("Illegal name. Save as %s instead (default: no)?"));
data/libqalculate-3.3.0/src/qalc.cc:2183:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				size_t l = name.length() + strlen(_("Illegal name. Save as %s instead (default: no)?"));
data/libqalculate-3.3.0/src/qalc.cc:2240:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				size_t l = name.length() + strlen(_("Illegal name. Save as %s instead (default: no)?"));
data/libqalculate-3.3.0/src/qalc.cc:2588:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					to_str.erase(0, strlen(SIGN_MINUS));
data/libqalculate-3.3.0/src/qalc.cc:2771:80:  [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).
#define PRINT_AND_COLON_TABS(x, s) str = x; pctl = unicode_length_check(x); if(strlen(s) > 0) {str += " (" s ")"; pctl += unicode_length_check(" (" s ")");} do {str += '\t'; pctl += 8;} while(pctl < 48);
data/libqalculate-3.3.0/src/qalc.cc:3488:89:  [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).
#define STR_AND_TABS_SET(x, s) str = "- "; BEGIN_BOLD(str); str += x; END_BOLD(str); if(strlen(s) > 0) {str += " ("; str += s; str += ")";} str += "\n";
data/libqalculate-3.3.0/src/qalc.cc:3489:31:  [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).
#define SET_DESCRIPTION(s) if(strlen(s) > 0) {BEGIN_ITALIC(str); str += s; END_ITALIC(str); str += "\n";}
data/libqalculate-3.3.0/src/qalc.cc:4016:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	size_t i_equals = str.find(_("approx.")) + strlen(_("approx."));
data/libqalculate-3.3.0/src/qalc.cc:4063:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if(!read(&x) || !x) break;
data/libqalculate-3.3.0/src/qalc.cc:4066:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if(!read(&x)) break;
data/libqalculate-3.3.0/src/qalc.cc:4101:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			read(&po.is_approximate);
data/libqalculate-3.3.0/src/qalc.cc:4239:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
						if(read(STDIN_FILENO, &c, 1) == -1) c = 0;
data/libqalculate-3.3.0/src/qalc.cc:4242:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					if(read(STDIN_FILENO, &c, 1) == -1) c = 0;
data/libqalculate-3.3.0/src/qalc.cc:4402:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if(!read(&command_type)) break;
data/libqalculate-3.3.0/src/qalc.cc:4404:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if(!read(&x) || !x) break;
data/libqalculate-3.3.0/src/qalc.cc:4513:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
						if(read(STDIN_FILENO, &c, 1) == -1) c = 0;
data/libqalculate-3.3.0/src/qalc.cc:4516:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					if(read(STDIN_FILENO, &c, 1) == -1) c = 0;
data/libqalculate-3.3.0/src/qalc.cc:4671:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
					to_str.erase(0, strlen(SIGN_MINUS));
data/libqalculate-3.3.0/src/qalc.cc:5009:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
						if(read(STDIN_FILENO, &c, 1) == -1) c = 0;
data/libqalculate-3.3.0/src/qalc.cc:5012:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					if(read(STDIN_FILENO, &c, 1) == -1) c = 0;

ANALYSIS SUMMARY:

Hits = 191
Lines analyzed = 89257 in approximately 2.71 seconds (32960 lines/second)
Physical Source Lines of Code (SLOC) = 83094
Hits@level = [0] 162 [1] 125 [2]  51 [3]   7 [4]   8 [5]   0
Hits@level+ = [0+] 353 [1+] 191 [2+]  66 [3+]  15 [4+]   8 [5+]   0
Hits/KSLOC@level+ = [0+] 4.2482 [1+] 2.2986 [2+] 0.794281 [3+] 0.180518 [4+] 0.0962765 [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.