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/cadabra-1.46/gui/help.cc
Examining data/cadabra-1.46/gui/main.cc
Examining data/cadabra-1.46/gui/widgets.cc
Examining data/cadabra-1.46/gui/window.cc
Examining data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp
Examining data/cadabra-1.46/osx/dylibbundler/src/Dependency.h
Examining data/cadabra-1.46/osx/dylibbundler/src/DylibBundler.cpp
Examining data/cadabra-1.46/osx/dylibbundler/src/DylibBundler.h
Examining data/cadabra-1.46/osx/dylibbundler/src/Settings.cpp
Examining data/cadabra-1.46/osx/dylibbundler/src/Settings.h
Examining data/cadabra-1.46/osx/dylibbundler/src/Utils.cpp
Examining data/cadabra-1.46/osx/dylibbundler/src/Utils.h
Examining data/cadabra-1.46/osx/dylibbundler/src/main.cpp
Examining data/cadabra-1.46/src/algorithm.cc
Examining data/cadabra-1.46/src/combinatorics.cc
Examining data/cadabra-1.46/src/config.h
Examining data/cadabra-1.46/src/defaults.cc
Examining data/cadabra-1.46/src/display.cc
Examining data/cadabra-1.46/src/main.cc
Examining data/cadabra-1.46/src/manipulator.cc
Examining data/cadabra-1.46/src/modules/algebra.cc
Examining data/cadabra-1.46/src/modules/combinat.cc
Examining data/cadabra-1.46/src/modules/convert.cc
Examining data/cadabra-1.46/src/modules/diff_geometry.cc
Examining data/cadabra-1.46/src/modules/dummies.cc
Examining data/cadabra-1.46/src/modules/eval.cc
Examining data/cadabra-1.46/src/modules/field_theory.cc
Examining data/cadabra-1.46/src/modules/gamma.cc
Examining data/cadabra-1.46/src/modules/lie.cc
Examining data/cadabra-1.46/src/modules/linear.cc
Examining data/cadabra-1.46/src/modules/lists.cc
Examining data/cadabra-1.46/src/modules/numerical.cc
Examining data/cadabra-1.46/src/modules/output.cc
Examining data/cadabra-1.46/src/modules/pertstring.cc
Examining data/cadabra-1.46/src/modules/properties.cc
Examining data/cadabra-1.46/src/modules/relativity.cc
Examining data/cadabra-1.46/src/modules/select.cc
Examining data/cadabra-1.46/src/modules/substitute.cc
Examining data/cadabra-1.46/src/modules/tableaux.cc
Examining data/cadabra-1.46/src/modules/xperm.c
Examining data/cadabra-1.46/src/modules/xperm.h
Examining data/cadabra-1.46/src/modules/xperm_new.c
Examining data/cadabra-1.46/src/modules/xperm_new.cc
Examining data/cadabra-1.46/src/modules/xperm_new.h
Examining data/cadabra-1.46/src/parser.cc
Examining data/cadabra-1.46/src/preprocessor.cc
Examining data/cadabra-1.46/src/props.cc
Examining data/cadabra-1.46/src/settings.cc
Examining data/cadabra-1.46/src/stopwatch.cc
Examining data/cadabra-1.46/src/storage.cc
Examining data/cadabra-1.46/src/test_combinatorics.cc
Examining data/cadabra-1.46/src/test_gmp.cc
Examining data/cadabra-1.46/src/test_lie.cc
Examining data/cadabra-1.46/src/test_parser.cc
Examining data/cadabra-1.46/src/test_preprocessor.cc
Examining data/cadabra-1.46/src/test_tree.cc
Examining data/cadabra-1.46/src/test_xperm.cc
Examining data/cadabra-1.46/src/test_young.cc
Examining data/cadabra-1.46/src/tree_example.cc
Examining data/cadabra-1.46/src/tree_example2.cc
Examining data/cadabra-1.46/src/tree_regression_tests.cc
Examining data/cadabra-1.46/src/txt_gui.cc
Examining data/cadabra-1.46/src/youngtab.cc
Examining data/cadabra-1.46/src/exchange.cc

FINAL RESULTS:

data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp: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.
    const bool is_symlink = system( (cmd+" > /dev/null").c_str())==0;
data/cadabra-1.46/osx/dylibbundler/src/Utils.cpp:65:9:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
    if (access( filename.c_str(), F_OK ) != -1)
data/cadabra-1.46/osx/dylibbundler/src/Utils.cpp:75:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
        if (access( ftrimmed.c_str(), F_OK ) != -1)
data/cadabra-1.46/osx/dylibbundler/src/Utils.cpp:139:26:  [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.
        command_output = popen(cmd.c_str(), "r");
data/cadabra-1.46/osx/dylibbundler/src/Utils.cpp:169: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.
    return system(cmd.c_str());
data/cadabra-1.46/gui/main.cc:46: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.
	char *pbs_job=getenv("PBS_JOBID");
data/cadabra-1.46/gui/main.cc:50:15:  [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 *cdblog=getenv("CDB_LOG");
data/cadabra-1.46/gui/main.cc:63:15:  [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 *texinp=getenv("TEXINPUTS");
data/cadabra-1.46/gui/window.cc:3267:22:  [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.
	std::string defname=getenv("HOME");
data/cadabra-1.46/gui/window.cc:3282:22:  [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.
	std::string defname=getenv("HOME");
data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp:40:30:  [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 *dyldLibPath = std::getenv("DYLD_LIBRARY_PATH");
data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp:43:24:  [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.
    dyldLibPath = std::getenv("DYLD_FALLBACK_FRAMEWORK_PATH");
data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp:49:24:  [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.
    dyldLibPath = std::getenv("DYLD_FALLBACK_LIBRARY_PATH");
data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp:83:17:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
        if (not realpath(path.c_str(), original_file_buffer))
data/cadabra-1.46/src/algorithm.cc:240:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
					if(getenv("CDB_PARANOID")) 					
data/cadabra-1.46/src/algorithm.cc:569:5:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	if(getenv("CDB_PARANOID")) 
data/cadabra-1.46/src/display.cc:35: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.
	: 	tight_star(getenv("CDB_TIGHTSTAR")), tight_plus(getenv("CDB_TIGHTPLUS")), 
data/cadabra-1.46/src/display.cc:35:53:  [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.
	: 	tight_star(getenv("CDB_TIGHTSTAR")), tight_plus(getenv("CDB_TIGHTPLUS")), 
data/cadabra-1.46/src/display.cc:36: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.
 	   tight_brackets(getenv("CDB_TIGHTBRACKETS")),
data/cadabra-1.46/src/display.cc:37:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
		print_star(getenv("CDB_PRINTSTAR")), output_format(of),
data/cadabra-1.46/src/display.cc:1086:63:  [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(parent.output_format==exptree_output::out_mathematica && getenv("CDB_MATH_COMPAC")==0) {
data/cadabra-1.46/src/display.cc:1331:63:  [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(parent.output_format==exptree_output::out_mathematica && getenv("CDB_MATH_COMPAC")==0) {
data/cadabra-1.46/src/main.cc:128: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.
	char *pbs_job=getenv("PBS_JOBID");
data/cadabra-1.46/src/main.cc:131:15:  [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 *cdblog=getenv("CDB_LOG");
data/cadabra-1.46/src/main.cc:263:24:  [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.
			std::string defname=getenv("HOME");
data/cadabra-1.46/src/main.cc:355:7:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
			if(getenv("CDB_LOG"))
data/cadabra-1.46/src/main.cc:366:7:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
			if(getenv("CDB_LOG"))
data/cadabra-1.46/src/manipulator.cc:49: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.
	  utf8_output(getenv("CDB_USE_UTF8")), status_output(false), prompt_string(">")
data/cadabra-1.46/src/manipulator.cc:654:8:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
				if(getenv("CDB_ERRORS_ARE_FATAL")) {
data/cadabra-1.46/src/manipulator.cc:1151:7:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
			if(getenv("JUSTPROFILE"))
data/cadabra-1.46/src/modules/field_theory.cc:2179:11:  [3] (random) random:
  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.
					rval=random()%(to-from+1);
data/cadabra-1.46/src/modules/field_theory.cc:2224:12:  [3] (random) random:
  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.
			int rnd=random()%index_sets_left;
data/cadabra-1.46/src/modules/field_theory.cc:2242:8:  [3] (random) random:
  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.
			rnd=random()%index_sets_left;
data/cadabra-1.46/src/storage.cc:78:20:  [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.
	bool compact_tree=getenv("CDB_COMPACTTREE");
data/cadabra-1.46/gui/help.cc:127:3:  [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 path[MAX_PATH];
data/cadabra-1.46/gui/help.cc:164:13:  [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).
		 helpfile.open((DESTDIR+std::string("/share/doc/cadabra/general.tex")).c_str());
data/cadabra-1.46/gui/main.cc:44: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 hostname[256];
data/cadabra-1.46/gui/main.cc:52: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).
		debugout.open("/dev/null", std::ios::app);
data/cadabra-1.46/gui/main.cc:53:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	else switch(atoi(cdblog)) {
data/cadabra-1.46/gui/main.cc:55:13:  [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).
			debugout.open(logname.c_str(), std::ios::app);
data/cadabra-1.46/gui/main.cc:58:13:  [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).
			debugout.open("/dev/tty", std::ios::app);
data/cadabra-1.46/gui/main.cc:88: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 path[MAX_PATH];
data/cadabra-1.46/gui/widgets.cc:226: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 olddir[1024];
data/cadabra-1.46/gui/widgets.cc:257:11:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
	int fd = mkstemp(templ);
data/cadabra-1.46/gui/window.cc:2410:47:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				else if(progress_todo==-1)  progress_todo=atoi(str.c_str());
data/cadabra-1.46/gui/window.cc:2411:47:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				else if(progress_done==-1)  progress_done=atoi(str.c_str());
data/cadabra-1.46/gui/window.cc:2412:48:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				else                        progress_count=atoi(str.c_str());
data/cadabra-1.46/gui/window.cc:3299:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
					int tmp=atoi(rl.substr(pos+2).c_str());
data/cadabra-1.46/gui/window.cc:3308:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
					int tmp=atoi(rl.substr(pos+2).c_str());
data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp:78:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char original_file_buffer[PATH_MAX];
data/cadabra-1.46/osx/dylibbundler/src/Dependency.cpp:134:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buffer[128];
data/cadabra-1.46/osx/dylibbundler/src/Utils.cpp:132:5:  [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 output[128];
data/cadabra-1.46/src/algorithm.cc:1047:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
				int thenum=atoi((*it->first.begin()->name).substr(pos).c_str());
data/cadabra-1.46/src/display.cc:1519:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char buffer[7];
data/cadabra-1.46/src/main.cc:126: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 hostname[256];
data/cadabra-1.46/src/main.cc:133: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).
		debugout.open("/dev/null", std::ios::app);
data/cadabra-1.46/src/main.cc:134:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	else switch(atoi(cdblog)) {
data/cadabra-1.46/src/main.cc:136:13:  [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).
			debugout.open(logname.c_str(), std::ios::app);
data/cadabra-1.46/src/main.cc:139:13:  [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).
			debugout.open("/dev/tty", std::ios::app);
data/cadabra-1.46/src/main.cc:277: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).
			int orig_fd=open(inputfile.c_str(), O_RDONLY);
data/cadabra-1.46/src/main.cc:281:17:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
				int temp_fd=mkstemp(temp_name);
data/cadabra-1.46/src/main.cc:283:6:  [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[8192];
data/cadabra-1.46/src/manipulator.cc:457: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).
						testfile.open(filename.c_str());
data/cadabra-1.46/src/manipulator.cc:467: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).
							output_file.open(filename.c_str(), std::ofstream::out);
data/cadabra-1.46/src/manipulator.cc:1206:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			  act_at_level=atoi(level.c_str());
data/cadabra-1.46/src/modules/algebra.cc:1636:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	int eqno=atoi((*tr.begin(it)->name).c_str());
data/cadabra-1.46/src/modules/lie.cc:115: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[20];
data/cadabra-1.46/src/modules/lie.cc:124:9:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	return atoi(buf);
data/cadabra-1.46/src/modules/lie.cc:134: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[2];
data/cadabra-1.46/src/modules/lie.cc:152: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[200];
data/cadabra-1.46/src/modules/lie.cc:181:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
					tmp.multiplicity=atoi(buffer);
data/cadabra-1.46/src/modules/lie.cc:194:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
					tmp.weight.push_back(atoi(buffer));
data/cadabra-1.46/src/modules/lie.cc:200:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
					tmp.weight.push_back(atoi(buffer));
data/cadabra-1.46/src/test_tree.cc:113:11:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		maxloop=atoi(argv[1]);
data/cadabra-1.46/src/test_xperm.cc:30: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.
	const char *indexnames[6]={"r", "s", "m", "m", "n", "n"};
data/cadabra-1.46/gui/window.cc:1408: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).
					if(helpname.size()<strlen(autocomplete_strings[i])) {
data/cadabra-1.46/gui/window.cc:1414: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).
									for(; j<std::min(candidate.size(), strlen(autocomplete_strings[i])); ++j) 
data/cadabra-1.46/src/main.cc:285:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					while((read_len=read(orig_fd, buffer, 8192))!=0) {
data/cadabra-1.46/src/modules/algebra.cc:2400:12:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
				if(!tr.equal(tr.begin(it1), sibling_iterator(nxt), tr.begin(it2))) 
data/cadabra-1.46/src/modules/lie.cc:137:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if(lie_proc.read(buf, 1)==0) {

ANALYSIS SUMMARY:

Hits = 80
Lines analyzed = 38410 in approximately 1.02 seconds (37561 lines/second)
Physical Source Lines of Code (SLOC) = 27396
Hits@level = [0] 403 [1]   5 [2]  41 [3]  29 [4]   5 [5]   0
Hits@level+ = [0+] 483 [1+]  80 [2+]  75 [3+]  34 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 17.6303 [1+] 2.92013 [2+] 2.73763 [3+] 1.24106 [4+] 0.182508 [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.