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/ignition-fuel-tools-4.1.0+dfsg/example/details.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/example/download.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/example/list.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/FuelClient.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/FuelClient_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Interface.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Interface_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/JSONParser.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/JSONParser_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/LocalCache.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/LocalCache_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Model.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ModelIdentifier.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ModelIdentifier_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ModelIter.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ModelIter_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Model_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/RestClient.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/RestClient_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Result.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Result_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/WorldIdentifier.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/WorldIdentifier_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/WorldIter.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/WorldIter_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Zip.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/Zip_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ign_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/src/ign_src_TEST.cc Examining data/ignition-fuel-tools-4.1.0+dfsg/test/integration/zip.cc FINAL RESULTS: data/ignition-fuel-tools-4.1.0+dfsg/src/ign_TEST.cc:31:16: [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(_cmd.c_str(), "r"); data/ignition-fuel-tools-4.1.0+dfsg/src/Zip_TEST.cc:34:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *tmp = getenv("TMPDIR"); data/ignition-fuel-tools-4.1.0+dfsg/src/Zip_TEST.cc:57:7: [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 (realpath(dtemp, resolved) == nullptr) data/ignition-fuel-tools-4.1.0+dfsg/src/Zip_TEST.cc:98:3: [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(static_cast<uint32_t>(time(nullptr))); data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig.cc:253:14: [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 *fh = fopen(_file.c_str(), "r"); data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig_TEST.cc:90:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofs.open(testPath, std::ofstream::out | std::ofstream::app); data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig_TEST.cc:131:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofs.open(testPath, std::ofstream::out | std::ofstream::app); data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig_TEST.cc:162:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofs.open(testPath, std::ofstream::out | std::ofstream::app); data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig_TEST.cc:186:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofs.open(testPath, std::ofstream::out | std::ofstream::app); data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig_TEST.cc:210:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofs.open(testPath, std::ofstream::out | std::ofstream::app); data/ignition-fuel-tools-4.1.0+dfsg/src/ClientConfig_TEST.cc:231:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofs.open(testPath, std::ofstream::out | std::ofstream::app); data/ignition-fuel-tools-4.1.0+dfsg/src/JSONParser_TEST.cc:56: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[100]; data/ignition-fuel-tools-4.1.0+dfsg/src/JSONParser_TEST.cc:105: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[100]; data/ignition-fuel-tools-4.1.0+dfsg/src/ModelIter_TEST.cc:54: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 buf[10]; data/ignition-fuel-tools-4.1.0+dfsg/src/ModelIter_TEST.cc:76: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 buf[10]; data/ignition-fuel-tools-4.1.0+dfsg/src/RestClient.cc:189: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 errbuf[CURL_ERROR_SIZE]; data/ignition-fuel-tools-4.1.0+dfsg/src/WorldIter_TEST.cc:53: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 buf[10]; data/ignition-fuel-tools-4.1.0+dfsg/src/Zip_TEST.cc:56: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 resolved[PATH_MAX]; data/ignition-fuel-tools-4.1.0+dfsg/src/Zip_TEST.cc:70: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). int fd = open(_filename.c_str(), O_RDWR | O_CREAT, 0644); data/ignition-fuel-tools-4.1.0+dfsg/src/Zip_TEST.cc:91: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 tempPath[MAX_PATH + 1]; data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:551: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). ignition::common::Console::SetVerbosity(std::atoi(_verbosity)); data/ignition-fuel-tools-4.1.0+dfsg/src/ign_TEST.cc:36: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[128]; data/ignition-fuel-tools-4.1.0+dfsg/src/ign_src_TEST.cc:237:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofs.open(testPath, std::ofstream::out | std::ofstream::app); data/ignition-fuel-tools-4.1.0+dfsg/src/RestClient.cc:299: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). size_t len = strlen(errbuf); data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:287: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). if (_configFile && strlen(_configFile) > 0) data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:377: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). if (_configFile && strlen(_configFile) > 0) data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:461: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). if (_configFile && strlen(_configFile) > 0) data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:491: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). if (_header && strlen(_header) > 0) data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:571: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). if (_url && std::strlen(_url) != 0) data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:576: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). if (_header && strlen(_header) > 0) data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:581: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). if (_private && std::strlen(_private) != 0) data/ignition-fuel-tools-4.1.0+dfsg/src/ign.cc:635: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). if (_header && strlen(_header) > 0) ANALYSIS SUMMARY: Hits = 32 Lines analyzed = 9989 in approximately 0.28 seconds (35185 lines/second) Physical Source Lines of Code (SLOC) = 7014 Hits@level = [0] 10 [1] 9 [2] 19 [3] 3 [4] 1 [5] 0 Hits@level+ = [0+] 42 [1+] 32 [2+] 23 [3+] 4 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 5.98802 [1+] 4.5623 [2+] 3.27916 [3+] 0.570288 [4+] 0.142572 [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.