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/rsbackup-6.0/src/EventLoop.h Examining data/rsbackup-6.0/src/test-lock.cc Examining data/rsbackup-6.0/src/HTML.cc Examining data/rsbackup-6.0/src/Date.h Examining data/rsbackup-6.0/src/Email.h Examining data/rsbackup-6.0/src/DeviceAccess.h Examining data/rsbackup-6.0/src/test-confbase.cc Examining data/rsbackup-6.0/src/PrunePolicyAge.cc Examining data/rsbackup-6.0/src/BackupPolicy.h Examining data/rsbackup-6.0/src/Subprocess.h Examining data/rsbackup-6.0/src/Volume.h Examining data/rsbackup-6.0/src/Indent.h Examining data/rsbackup-6.0/src/Conf.cc Examining data/rsbackup-6.0/src/ConfDirective.cc Examining data/rsbackup-6.0/src/Selection.cc Examining data/rsbackup-6.0/src/IO.h Examining data/rsbackup-6.0/src/test-database.cc Examining data/rsbackup-6.0/src/Date.cc Examining data/rsbackup-6.0/src/test-check.cc Examining data/rsbackup-6.0/src/test-progress.cc Examining data/rsbackup-6.0/src/Device.h Examining data/rsbackup-6.0/src/ColorStrategy.cc Examining data/rsbackup-6.0/src/Unicode.cc Examining data/rsbackup-6.0/src/base64.cc Examining data/rsbackup-6.0/src/test-subprocess.cc Examining data/rsbackup-6.0/src/Store.cc Examining data/rsbackup-6.0/src/test-io.cc Examining data/rsbackup-6.0/src/test-date.cc Examining data/rsbackup-6.0/src/Command.cc Examining data/rsbackup-6.0/src/Volume.cc Examining data/rsbackup-6.0/src/Prune.cc Examining data/rsbackup-6.0/src/test-tolines.cc Examining data/rsbackup-6.0/src/Indent.cc Examining data/rsbackup-6.0/src/test-select.cc Examining data/rsbackup-6.0/src/Host.h Examining data/rsbackup-6.0/src/test-color.cc Examining data/rsbackup-6.0/src/Defaults.h Examining data/rsbackup-6.0/src/MakeBackup.cc Examining data/rsbackup-6.0/src/rsbackup.cc Examining data/rsbackup-6.0/src/test-parseinteger.cc Examining data/rsbackup-6.0/src/test-base64.cc Examining data/rsbackup-6.0/src/Store.h Examining data/rsbackup-6.0/src/PrunePolicy.h Examining data/rsbackup-6.0/src/test-action.cc Examining data/rsbackup-6.0/src/test-host.cc Examining data/rsbackup-6.0/src/test-unicode.cc Examining data/rsbackup-6.0/src/test-directory.cc Examining data/rsbackup-6.0/src/Check.cc Examining data/rsbackup-6.0/src/Utils.h Examining data/rsbackup-6.0/src/Directory.cc Examining data/rsbackup-6.0/src/ConfDirective.h Examining data/rsbackup-6.0/src/BackupPolicyAlways.cc Examining data/rsbackup-6.0/src/timestamp.cc Examining data/rsbackup-6.0/src/Progress.cc Examining data/rsbackup-6.0/src/Report.h Examining data/rsbackup-6.0/src/HistoryGraph.cc Examining data/rsbackup-6.0/src/RetireDevices.cc Examining data/rsbackup-6.0/src/test-split.cc Examining data/rsbackup-6.0/src/rsbackup-graph.cc Examining data/rsbackup-6.0/src/Selection.h Examining data/rsbackup-6.0/src/ConfBase.h Examining data/rsbackup-6.0/src/Command.h Examining data/rsbackup-6.0/src/PrunePolicyDecay.cc Examining data/rsbackup-6.0/src/test-eventloop.cc Examining data/rsbackup-6.0/src/Subprocess.cc Examining data/rsbackup-6.0/src/Render.cc Examining data/rsbackup-6.0/src/Backup.h Examining data/rsbackup-6.0/src/HistoryGraph.h Examining data/rsbackup-6.0/src/FileLock.cc Examining data/rsbackup-6.0/src/BackupPolicyDaily.cc Examining data/rsbackup-6.0/src/Prune.h Examining data/rsbackup-6.0/src/Database.h Examining data/rsbackup-6.0/src/BulkRemove.h Examining data/rsbackup-6.0/src/rsbackup.h Examining data/rsbackup-6.0/src/stylesheet.cc Examining data/rsbackup-6.0/src/BulkRemove.cc Examining data/rsbackup-6.0/src/parseInteger.cc Examining data/rsbackup-6.0/src/Database.cc Examining data/rsbackup-6.0/src/DeviceAccess.cc Examining data/rsbackup-6.0/src/Color.cc Examining data/rsbackup-6.0/src/Action.cc Examining data/rsbackup-6.0/src/parseFloat.cc Examining data/rsbackup-6.0/src/test-command.cc Examining data/rsbackup-6.0/src/IO.cc Examining data/rsbackup-6.0/src/Color.h Examining data/rsbackup-6.0/src/Errors.h Examining data/rsbackup-6.0/src/Render.h Examining data/rsbackup-6.0/src/Document.h Examining data/rsbackup-6.0/src/Action.h Examining data/rsbackup-6.0/src/RetireVolumes.cc Examining data/rsbackup-6.0/src/Report.cc Examining data/rsbackup-6.0/src/Errors.cc Examining data/rsbackup-6.0/src/PrunePolicy.cc Examining data/rsbackup-6.0/src/ConfBase.cc Examining data/rsbackup-6.0/src/Backup.cc Examining data/rsbackup-6.0/src/debug.cc Examining data/rsbackup-6.0/src/substitute.cc Examining data/rsbackup-6.0/src/PrunePolicyExec.cc Examining data/rsbackup-6.0/src/EventLoop.cc Examining data/rsbackup-6.0/src/test-globfiles.cc Examining data/rsbackup-6.0/src/nonblock.cc Examining data/rsbackup-6.0/src/Device.cc Examining data/rsbackup-6.0/src/Document.cc Examining data/rsbackup-6.0/src/test-volume.cc Examining data/rsbackup-6.0/src/BackupPolicy.cc Examining data/rsbackup-6.0/src/Email.cc Examining data/rsbackup-6.0/src/test-device.cc Examining data/rsbackup-6.0/src/FileLock.h Examining data/rsbackup-6.0/src/globFiles.cc Examining data/rsbackup-6.0/src/BackupPolicyInterval.cc Examining data/rsbackup-6.0/src/PrunePolicyNever.cc Examining data/rsbackup-6.0/src/test-timespec.cc Examining data/rsbackup-6.0/src/test-indent.cc Examining data/rsbackup-6.0/src/test-prunedecay.cc Examining data/rsbackup-6.0/src/error.cc Examining data/rsbackup-6.0/src/Host.cc Examining data/rsbackup-6.0/src/Conf.h Examining data/rsbackup-6.0/src/split.cc Examining data/rsbackup-6.0/src/toLines.cc Examining data/rsbackup-6.0/src/Text.cc FINAL RESULTS: data/rsbackup-6.0/src/Email.cc:33:8: [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. mail.popen(command, WriteToPipe, !!(globalWarningMask & WARNING_VERBOSE)); data/rsbackup-6.0/src/IO.cc:39: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. void IO::popen(const std::vector<std::string> &command, data/rsbackup-6.0/src/IO.cc:117:8: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. rc = vfprintf(fp, format, ap); data/rsbackup-6.0/src/IO.cc:125:12: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. int rc = vfprintf(fp, format, ap); data/rsbackup-6.0/src/IO.h:81:8: [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. void popen(const std::vector<std::string> &command, data/rsbackup-6.0/src/PrunePolicyExec.cc:36:8: [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(path.c_str(), X_OK) < 0) data/rsbackup-6.0/src/Subprocess.cc:135:7: [4] (shell) execvp: 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. execvp(args[0], (char **)&args[0]); data/rsbackup-6.0/src/Subprocess.cc:270:8: [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(p.c_str(), X_OK) == 0) data/rsbackup-6.0/src/debug.cc:26:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, ap); data/rsbackup-6.0/src/test-globfiles.cc:76:11: [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 r = system(("rm -rf " + (std::string)dir).c_str()); data/rsbackup-6.0/src/test-io.cc:59:5: [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. f.popen(command, ReadFromPipe, false); data/rsbackup-6.0/src/Command.cc:140:6: [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("RSBACKUP_DEBUG")) data/rsbackup-6.0/src/Command.cc:145:14: [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((n = getopt_long(argc, (char *const *)argv, data/rsbackup-6.0/src/Date.cc:171:31: [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 *override_time = getenv("RSBACKUP_TIME"); data/rsbackup-6.0/src/Report.cc:434:6: [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("RSBACKUP_TIME")) { data/rsbackup-6.0/src/Subprocess.cc:253:23: [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 *pathc = getenv("PATH"); data/rsbackup-6.0/src/rsbackup-graph.cc:82: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("RSBACKUP_DEBUG")) data/rsbackup-6.0/src/rsbackup-graph.cc:90:16: [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((n = getopt_long(argc, (char *const *)argv, data/rsbackup-6.0/src/substitute.cc:43:31: [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 *value = getenv(name.c_str()); data/rsbackup-6.0/src/test-globfiles.cc:35:12: [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. tmpdir = getenv("TMPDIR"); data/rsbackup-6.0/src/Check.cc:28: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[64]; data/rsbackup-6.0/src/Conf.cc:268:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). input.open(path, "r"); data/rsbackup-6.0/src/Conf.cc:462: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). input.open(logs + "/" + files[n], "r"); data/rsbackup-6.0/src/Date.cc:115: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[64]; data/rsbackup-6.0/src/Date.cc:121: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[256]; data/rsbackup-6.0/src/Directory.cc:26:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). void Directory::open(const std::string &path_) { data/rsbackup-6.0/src/Directory.cc:70:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). d.open(path); data/rsbackup-6.0/src/Document.cc:33: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[64]; data/rsbackup-6.0/src/Errors.cc:35: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 buffer[64]; data/rsbackup-6.0/src/Errors.cc:40: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 buffer[64]; data/rsbackup-6.0/src/EventLoop.cc:137:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4096]; data/rsbackup-6.0/src/FileLock.cc:33:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if((fd = open(path.c_str(), O_WRONLY|O_CREAT, 0666)) < 0) data/rsbackup-6.0/src/HTML.cc:55: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[64]; data/rsbackup-6.0/src/HTML.cc:133: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 tag[64]; data/rsbackup-6.0/src/HTML.cc:142: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 ws[64], hs[64]; data/rsbackup-6.0/src/Host.cc:146: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 buffer[64]; data/rsbackup-6.0/src/IO.cc:32:10: [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). void IO::open(const std::string &path_, const std::string &mode) { data/rsbackup-6.0/src/IO.cc:33:13: [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). if(!(fp = fopen(path_.c_str(), mode.c_str()))) data/rsbackup-6.0/src/IO.h:74: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). void open(const std::string &path, const std::string &mode); data/rsbackup-6.0/src/IO.h:214: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). void open(const std::string &path); data/rsbackup-6.0/src/MakeBackup.cc:156: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 buffer[64]; data/rsbackup-6.0/src/MakeBackup.cc:267: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). ifile.open(mb->incompletePath, "w"); data/rsbackup-6.0/src/MakeBackup.cc:485: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[1024]; data/rsbackup-6.0/src/Prune.cc:230:15: [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). ifile.open(incompletePath, "w"); data/rsbackup-6.0/src/Prune.cc:314:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). d.open(globalConfig.logs); data/rsbackup-6.0/src/PrunePolicyExec.cc:49: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 buffer[64]; data/rsbackup-6.0/src/Report.cc:112: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[1024]; data/rsbackup-6.0/src/Report.cc:351: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 timestr[64]; data/rsbackup-6.0/src/Store.cc:49: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). f->open(path + PATH_SEP + "device-id", "r"); data/rsbackup-6.0/src/Subprocess.cc:102:38: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if(nullfd < 0 && (nullfd = open(_PATH_DEVNULL, O_RDWR)) < 0) { data/rsbackup-6.0/src/Subprocess.cc:254: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[1024]; data/rsbackup-6.0/src/Text.cc:91: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 prefix[64]; data/rsbackup-6.0/src/Text.cc:100:7: [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. strcpy(prefix, " * "); data/rsbackup-6.0/src/rsbackup.cc:116: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). ssf.open(globalConfig.stylesheet, "r"); data/rsbackup-6.0/src/rsbackup.cc:135: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). f.open(*globalCommand.html, "w"); data/rsbackup-6.0/src/rsbackup.cc:147: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). f.open(*globalCommand.text, "w"); data/rsbackup-6.0/src/test-check.cc:44:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[1]; data/rsbackup-6.0/src/test-check.cc:66: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[1024]; data/rsbackup-6.0/src/test-directory.cc:25: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). d.open("."); data/rsbackup-6.0/src/test-directory.cc:42: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). d.open("."); data/rsbackup-6.0/src/test-directory.cc:50: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). d.open("/dev/null"); data/rsbackup-6.0/src/test-directory.cc:58: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). d.open("does not exist"); data/rsbackup-6.0/src/test-eventloop.cc:69: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[4096]; data/rsbackup-6.0/src/test-globfiles.cc:25: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(path, O_WRONLY|O_CREAT, 0666); data/rsbackup-6.0/src/test-io.cc:22:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f.open("test-io-tmp", "w"); data/rsbackup-6.0/src/test-io.cc:30:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f.open("test-io-tmp", "r"); data/rsbackup-6.0/src/test-io.cc:46:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f.open("test-io-tmp", "r"); data/rsbackup-6.0/src/test-lock.cc:25:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1]; data/rsbackup-6.0/src/test-lock.cc:29:10: [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). assert(mkstemp(path)); data/rsbackup-6.0/src/test-progress.cc:28: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/rsbackup-6.0/src/test-subprocess.cc:26:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char *warnings[64]; data/rsbackup-6.0/src/Command.cc:129: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(TAG) > 0) data/rsbackup-6.0/src/Conf.cc:256:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void Conf::read() { data/rsbackup-6.0/src/Conf.h:219:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(); data/rsbackup-6.0/src/EventLoop.cc:138:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t nbytes = read(fd, buffer, sizeof buffer); data/rsbackup-6.0/src/IO.cc:82:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((c = getc(fp)) != EOF && c != '\n') data/rsbackup-6.0/src/IO.cc:100:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((c = getc(fp)) != EOF) data/rsbackup-6.0/src/MakeBackup.cc:461:7: [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(1000); data/rsbackup-6.0/src/MakeBackup.cc:563:7: [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(100*000/*µs*/); data/rsbackup-6.0/src/Progress.cc:26: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). int bar = width - (3 + strlen(prompt)); data/rsbackup-6.0/src/Prune.cc:285:7: [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(1000); data/rsbackup-6.0/src/Text.cc:104: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). wordWrapText(os, ss.str(), 80 - strlen(prefix), strlen(prefix), false); data/rsbackup-6.0/src/Text.cc:104: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). wordWrapText(os, ss.str(), 80 - strlen(prefix), strlen(prefix), false); data/rsbackup-6.0/src/rsbackup-graph.cc:107:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). globalConfig.read(); data/rsbackup-6.0/src/rsbackup.cc:50:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). globalConfig.read(); data/rsbackup-6.0/src/test-check.cc:45:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, buffer, 1) < 0) data/rsbackup-6.0/src/test-eventloop.cc:70:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t n = ::read(p[0], buffer, sizeof buffer); data/rsbackup-6.0/src/test-lock.cc:44:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((rc = read(p[0], buf, 1)) < 0 && errno == EINTR) data/rsbackup-6.0/src/test-progress.cc:30:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((n = read(fd, buffer, sizeof buffer)) > 0) ANALYSIS SUMMARY: Hits = 89 Lines analyzed = 17253 in approximately 0.47 seconds (36991 lines/second) Physical Source Lines of Code (SLOC) = 10291 Hits@level = [0] 35 [1] 18 [2] 51 [3] 9 [4] 11 [5] 0 Hits@level+ = [0+] 124 [1+] 89 [2+] 71 [3+] 20 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 12.0494 [1+] 8.64833 [2+] 6.89923 [3+] 1.94345 [4+] 1.0689 [5+] 0 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.