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/ccbuild-2.0.7+git20160227.c1179286/src/globallocks/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/FlexLexer.h Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/lexer.h Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/storeGlobal.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/storeLocal.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/includes.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/yylex.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/hasDefine.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/sourceScanner.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/storeIgnore.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/hasMainFunction.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.h Examining data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/directDeps.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/buildObjectTarget.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/changed.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/basenameWithoutExtension.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/dependencies.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/markAsDone.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/scan.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/stale.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/isInternalHeader.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/source.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/hasSourceExtension.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/producesOutput.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/upToDate.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/directory.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/isLibTarget.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/genDeps.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/isHeader.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/build.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/isBinTarget.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/buildHeader.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/buildBinTarget.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/isLocalHeader.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/setType.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/reload.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/isObjectTarget.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/source/outputFilename.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/rename.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/cleanPath.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/baseName.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/fileName.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/isReadable.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/absolutePath.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/directoryName.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/fileExists.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/cwd.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/newer.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/modTime.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/test.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/touch.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/globSourceFilesInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/globFilesInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/rmIfExists.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/globDirectoriesInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/globInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/rmDirectoryIfExists.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/recursiveGlobDirectoriesInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/ensureDirectory.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/isDirectory.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/splitInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/ar.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/countFirstLinkerArguments.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/precompileCommand.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/libCommand.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/operator_add.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/addObject.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/precompile.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/compile.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/linkCommand.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/link.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/cls.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/addArgument.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/compileCommand.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/lib.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/problem/problem.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/ccbuild.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/load.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/hashFilenameFor.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/MD5Info.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/getInstance.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/destroy.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/contentHash.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/save.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/old.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/options/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/projectName.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/makefileForAll.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/makefileFor.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/dotgraphFor.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/clean.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/trim.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/buildAll.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/trimmed.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/uname.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/localSourcesInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/destroy.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/depsFor.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/aapForAll.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/test_system.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/addArguments.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/inspect.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/system.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/batchCompile.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/collectTargets.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/icmake.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/build.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/dotgraphForAll.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/username.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/md5.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/distclean.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/exit.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/changeTo.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/parseArguments.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/check.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/mkdtemp.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/sleep.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/resolveTest.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/aapFor.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/system/lib.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/getInstance.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/value.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/arguments.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/clear.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/destroy.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/flagged.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/values.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/initialize.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/outputOptions.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/resolver.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/getInstance.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/destroy.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/resolve.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/expand.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/resolveInto.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/loadIfExists.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/string/replace.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/string/toUpper.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/string/test.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/globals/globals.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/globals/getInstance.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/globals/destroy.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/globals/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/globals/indexoperator.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sources/getInstance.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sources/erase.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sources/reloadStaleSources.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sources/destroy.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sources/sources.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sources/statics.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/src/sources/indexoperator.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/parsetest.cpp Examining data/ccbuild-2.0.7+git20160227.c1179286/test/openmp_exceptions.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/threading/thread.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/include.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/arguments.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/attempt1.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/zeroblock_mem.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/argvtest.cc Examining data/ccbuild-2.0.7+git20160227.c1179286/test/container_const.cc FINAL RESULTS: data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/ar.cc:38:28: [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. int retValue = System::system(command.str().c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/compile.cc:32:28: [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. int retValue = System::system(command); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/compile.cc:40: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. System::system((Options::execOnFail + " \"" + target + "\"").c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/compile.cc:50:17: [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. System::system((Options::execOnPass + " \"" + target + "\"").c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/lib.cc:27:28: [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. int retValue = System::system(command.c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/lib.cc:48:24: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. retValue = System::system(lnc.c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/lib.cc:59:24: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. retValue = System::system(lnc.c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/link.cc:28:28: [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. int retValue = System::system(command.c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/link.cc:40:17: [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. System::system((Options::execOnPass + " \"" + outputFile + "\"").c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/precompile.cc:36:28: [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. int retValue = System::system(command.c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/precompile.cc:45: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. System::system((Options::execOnFail + " \"" + target + "\"").c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/precompile.cc:55:17: [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. System::system((Options::execOnPass + " \"" + target + "\"").c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/fileSystem/isReadable.cc:23:12: [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. return access(filename.c_str(), R_OK) == 0; data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/expand.cc:40: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 *f = popen(echo.c_str(), "r"); data/ccbuild-2.0.7+git20160227.c1179286/src/system/addArguments.cc:81:9: [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(newArgs[i], argv[i]); data/ccbuild-2.0.7+git20160227.c1179286/src/system/addArguments.cc:87:9: [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(newArgs[argc + i], p.we_wordv[i]); data/ccbuild-2.0.7+git20160227.c1179286/src/system/batchCompile.cc:94:17: [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. System::system(command); data/ccbuild-2.0.7+git20160227.c1179286/src/system/mkdtemp.cc:23:7: [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(tmpDirName, nameTemplate.c_str()); data/ccbuild-2.0.7+git20160227.c1179286/src/system/system.cc:20:13: [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. int System::system(std::string const &command, bool simulate) throw (Problem) { data/ccbuild-2.0.7+git20160227.c1179286/src/system/system.cc:32:41: [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 *processOutputDescriptor = popen(command.c_str(), "r"); data/ccbuild-2.0.7+git20160227.c1179286/src/system/test_system.cc:25:13: [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. System::system("echo hello"); data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/arguments.cc:152:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int c = getopt_long(argc, argv, letterFlags.str().c_str(), data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:322: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. home = getenv ("HOME"); data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:1528:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. value = getenv (env); data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:2297: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. ifs = getenv ("IFS"); data/ccbuild-2.0.7+git20160227.c1179286/test/parsetest.cpp:49:8: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while(getopt(argcbbb, argvbbb, "l:b:") != EOF); data/ccbuild-2.0.7+git20160227.c1179286/test/parsetest.cpp:55:8: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while(getopt_long(argcbbb, argvbbb, "l:b:", long_options, &index) != EOF); data/ccbuild-2.0.7+git20160227.c1179286/test/parsetest.cpp:166:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int c = getopt(argc, argv, "I:i:l:L:D:"); data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/contentHash.cc:27:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char md[MD5_DIGEST_LENGTH]; data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/contentHash.cc:43: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 hex_hash[(MD5_DIGEST_LENGTH * 2) + 1]; data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/contentHash.cc:45:13: [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(&hex_hash[i*2], "%02x", md[i]); data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/outputOptions.cc:27: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 spacer[32]; data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:726: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. char result[21]; /* 21 = ceil(log10(2^64)) + 1 */ data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:773: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. char result[21]; /* 21 = ceil(log10(2^64)) + 1 */ data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:819: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. const char *args[4] = { _PATH_BSHELL, "-c", comm, NULL }; data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:892: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[bufsize]; data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:1242: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[21]; data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:1437:15: [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 n = atoi (env); data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:1916:7: [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 param_length[21]; data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:2258: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 ifs_white[4]; data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:2301:11: [2] (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). Risk is low because the source is a constant string. ifs = strcpy (ifs_white, " \t\n"); data/ccbuild-2.0.7+git20160227.c1179286/src/resolver/expand.cc:43: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 buf[2]; // read 1 byte at the time data/ccbuild-2.0.7+git20160227.c1179286/src/system/addArguments.cc:76:27: [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 ** newArgs = new char *[argc + p.we_wordc + 1]; data/ccbuild-2.0.7+git20160227.c1179286/src/system/system.cc:37: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 buffer[1024]; data/ccbuild-2.0.7+git20160227.c1179286/test/attempt1.cc:56:7: [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). fp = fopen(filename.c_str(), "rb"); data/ccbuild-2.0.7+git20160227.c1179286/test/attempt1.cc:84: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 header[8]; // 8 is than maximum size that can be checked. data/ccbuild-2.0.7+git20160227.c1179286/src/MD5Info/contentHash.cc:36:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifile.read(buffer, bufferSize); data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/arguments.cc:95:17: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(const_cast<char *>(longOpts[nlongOpts].name), data/ccbuild-2.0.7+git20160227.c1179286/src/arguments/outputOptions.cc:30: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). unsigned spacerLen = strlen(spacer); data/ccbuild-2.0.7+git20160227.c1179286/src/ccbuild.cc:164:39: [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(index(argv[i], ' ') || strlen(argv[i]) == 0) { data/ccbuild-2.0.7+git20160227.c1179286/src/compiler/countFirstLinkerArguments.cc:78:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(arguments[count].size() == strlen(takeArg[i])) { data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:156:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (str); data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:1475: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). plist_len += strlen (__libc_argv[p]) + 1; /* for space */ data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:1697: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). end = value + strlen (value); data/ccbuild-2.0.7+git20160227.c1179286/src/posix/wordexp.c:1919: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). _itoa_word (value ? strlen (value) : 0, data/ccbuild-2.0.7+git20160227.c1179286/src/sourceScanner/yylex.cc:1194:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (void) yyin.read( buf, max_size ); data/ccbuild-2.0.7+git20160227.c1179286/src/system/addArguments.cc:80: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). newArgs[i] = new char[strlen(argv[i]) + 1]; data/ccbuild-2.0.7+git20160227.c1179286/src/system/addArguments.cc:86: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). newArgs[argc + i] = new char[strlen(p.we_wordv[i]) + 1]; data/ccbuild-2.0.7+git20160227.c1179286/test/parsetest.cpp:86:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(text, argument.c_str(), textSize); ANALYSIS SUMMARY: Hits = 59 Lines analyzed = 13702 in approximately 0.43 seconds (32015 lines/second) Physical Source Lines of Code (SLOC) = 7587 Hits@level = [0] 11 [1] 13 [2] 18 [3] 7 [4] 21 [5] 0 Hits@level+ = [0+] 70 [1+] 59 [2+] 46 [3+] 28 [4+] 21 [5+] 0 Hits/KSLOC@level+ = [0+] 9.22631 [1+] 7.77646 [2+] 6.063 [3+] 3.69052 [4+] 2.76789 [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.