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/oomd-0.4.0/src/oomd/CgroupContext.cpp Examining data/oomd-0.4.0/src/oomd/CgroupContext.h Examining data/oomd-0.4.0/src/oomd/CgroupContextTest.cpp Examining data/oomd-0.4.0/src/oomd/Log.cpp Examining data/oomd-0.4.0/src/oomd/Log.h Examining data/oomd-0.4.0/src/oomd/LogTest.cpp Examining data/oomd-0.4.0/src/oomd/Main.cpp Examining data/oomd-0.4.0/src/oomd/Oomd.cpp Examining data/oomd-0.4.0/src/oomd/Oomd.h Examining data/oomd-0.4.0/src/oomd/OomdContext.cpp Examining data/oomd-0.4.0/src/oomd/OomdContext.h Examining data/oomd-0.4.0/src/oomd/OomdContextTest.cpp Examining data/oomd-0.4.0/src/oomd/PluginConstructionContext.cpp Examining data/oomd-0.4.0/src/oomd/PluginConstructionContext.h Examining data/oomd-0.4.0/src/oomd/PluginRegistry.cpp Examining data/oomd-0.4.0/src/oomd/PluginRegistry.h Examining data/oomd-0.4.0/src/oomd/Stats.cpp Examining data/oomd-0.4.0/src/oomd/Stats.h Examining data/oomd-0.4.0/src/oomd/StatsClient.cpp Examining data/oomd-0.4.0/src/oomd/StatsClient.h Examining data/oomd-0.4.0/src/oomd/StatsTest.cpp Examining data/oomd-0.4.0/src/oomd/config/ConfigCompiler.cpp Examining data/oomd-0.4.0/src/oomd/config/ConfigCompiler.h Examining data/oomd-0.4.0/src/oomd/config/ConfigCompilerTest.cpp Examining data/oomd-0.4.0/src/oomd/config/ConfigTypes.cpp Examining data/oomd-0.4.0/src/oomd/config/ConfigTypes.h Examining data/oomd-0.4.0/src/oomd/config/JsonConfigParser.cpp Examining data/oomd-0.4.0/src/oomd/config/JsonConfigParser.h Examining data/oomd-0.4.0/src/oomd/config/JsonConfigParserTest.cpp Examining data/oomd-0.4.0/src/oomd/engine/BasePlugin.h Examining data/oomd-0.4.0/src/oomd/engine/DetectorGroup.cpp Examining data/oomd-0.4.0/src/oomd/engine/DetectorGroup.h Examining data/oomd-0.4.0/src/oomd/engine/Engine.cpp Examining data/oomd-0.4.0/src/oomd/engine/Engine.h Examining data/oomd-0.4.0/src/oomd/engine/EngineTypes.h Examining data/oomd-0.4.0/src/oomd/engine/Ruleset.cpp Examining data/oomd-0.4.0/src/oomd/engine/Ruleset.h Examining data/oomd-0.4.0/src/oomd/fixtures/FsFixture.cpp Examining data/oomd-0.4.0/src/oomd/fixtures/FsFixture.h Examining data/oomd-0.4.0/src/oomd/include/Assert.cpp Examining data/oomd-0.4.0/src/oomd/include/Assert.h Examining data/oomd-0.4.0/src/oomd/include/AssertTest.cpp Examining data/oomd-0.4.0/src/oomd/include/CgroupPath.cpp Examining data/oomd-0.4.0/src/oomd/include/CgroupPath.h Examining data/oomd-0.4.0/src/oomd/include/CgroupPathTest.cpp Examining data/oomd-0.4.0/src/oomd/include/CoreStats.h Examining data/oomd-0.4.0/src/oomd/include/Defines.h Examining data/oomd-0.4.0/src/oomd/include/Types.h Examining data/oomd-0.4.0/src/oomd/plugins/BaseKillPlugin.cpp Examining data/oomd-0.4.0/src/oomd/plugins/BaseKillPlugin.h Examining data/oomd-0.4.0/src/oomd/plugins/ContinuePlugin.cpp Examining data/oomd-0.4.0/src/oomd/plugins/ContinuePlugin.h Examining data/oomd-0.4.0/src/oomd/plugins/CorePluginsTest.cpp Examining data/oomd-0.4.0/src/oomd/plugins/DumpCgroupOverview.cpp Examining data/oomd-0.4.0/src/oomd/plugins/DumpCgroupOverview.h Examining data/oomd-0.4.0/src/oomd/plugins/DumpKillInfoNoOp.cpp Examining data/oomd-0.4.0/src/oomd/plugins/Exists.cpp Examining data/oomd-0.4.0/src/oomd/plugins/Exists.h Examining data/oomd-0.4.0/src/oomd/plugins/KillIOCost-inl.h Examining data/oomd-0.4.0/src/oomd/plugins/KillIOCost.cpp Examining data/oomd-0.4.0/src/oomd/plugins/KillIOCost.h Examining data/oomd-0.4.0/src/oomd/plugins/KillMemoryGrowth-inl.h Examining data/oomd-0.4.0/src/oomd/plugins/KillMemoryGrowth.cpp Examining data/oomd-0.4.0/src/oomd/plugins/KillMemoryGrowth.h Examining data/oomd-0.4.0/src/oomd/plugins/KillPressure-inl.h Examining data/oomd-0.4.0/src/oomd/plugins/KillPressure.cpp Examining data/oomd-0.4.0/src/oomd/plugins/KillPressure.h Examining data/oomd-0.4.0/src/oomd/plugins/KillSwapUsage-inl.h Examining data/oomd-0.4.0/src/oomd/plugins/KillSwapUsage.cpp Examining data/oomd-0.4.0/src/oomd/plugins/KillSwapUsage.h Examining data/oomd-0.4.0/src/oomd/plugins/MemoryAbove.cpp Examining data/oomd-0.4.0/src/oomd/plugins/MemoryAbove.h Examining data/oomd-0.4.0/src/oomd/plugins/MemoryReclaim.cpp Examining data/oomd-0.4.0/src/oomd/plugins/MemoryReclaim.h Examining data/oomd-0.4.0/src/oomd/plugins/NrDyingDescendants.cpp Examining data/oomd-0.4.0/src/oomd/plugins/NrDyingDescendants.h Examining data/oomd-0.4.0/src/oomd/plugins/PressureAbove.cpp Examining data/oomd-0.4.0/src/oomd/plugins/PressureAbove.h Examining data/oomd-0.4.0/src/oomd/plugins/PressureRisingBeyond.cpp Examining data/oomd-0.4.0/src/oomd/plugins/PressureRisingBeyond.h Examining data/oomd-0.4.0/src/oomd/plugins/Senpai.cpp Examining data/oomd-0.4.0/src/oomd/plugins/Senpai.h Examining data/oomd-0.4.0/src/oomd/plugins/StopPlugin.cpp Examining data/oomd-0.4.0/src/oomd/plugins/StopPlugin.h Examining data/oomd-0.4.0/src/oomd/plugins/SwapFree.cpp Examining data/oomd-0.4.0/src/oomd/plugins/SwapFree.h Examining data/oomd-0.4.0/src/oomd/plugins/systemd/BaseSystemdPlugin.cpp Examining data/oomd-0.4.0/src/oomd/plugins/systemd/BaseSystemdPlugin.h Examining data/oomd-0.4.0/src/oomd/plugins/systemd/SystemdPluginsTest.cpp Examining data/oomd-0.4.0/src/oomd/plugins/systemd/SystemdRestart-inl.h Examining data/oomd-0.4.0/src/oomd/plugins/systemd/SystemdRestart.cpp Examining data/oomd-0.4.0/src/oomd/plugins/systemd/SystemdRestart.h Examining data/oomd-0.4.0/src/oomd/util/Fixture.cpp Examining data/oomd-0.4.0/src/oomd/util/Fixture.h Examining data/oomd-0.4.0/src/oomd/util/FixtureTest.cpp Examining data/oomd-0.4.0/src/oomd/util/Fs.cpp Examining data/oomd-0.4.0/src/oomd/util/Fs.h Examining data/oomd-0.4.0/src/oomd/util/FsTest.cpp Examining data/oomd-0.4.0/src/oomd/util/ScopeGuard.h Examining data/oomd-0.4.0/src/oomd/util/ScopeGuardTest.cpp Examining data/oomd-0.4.0/src/oomd/util/TestHelper.h Examining data/oomd-0.4.0/src/oomd/util/Util.cpp Examining data/oomd-0.4.0/src/oomd/util/Util.h Examining data/oomd-0.4.0/src/oomd/util/UtilTest.cpp FINAL RESULTS: data/oomd-0.4.0/src/oomd/Stats.cpp:129:9: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (::chmod(stats_socket_path_.c_str(), 0666) < 0) { data/oomd-0.4.0/src/oomd/Stats.cpp:118:5: [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(serv_addr_.sun_path, stats_socket_path_.c_str()); data/oomd-0.4.0/src/oomd/StatsClient.cpp:53:5: [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(serv_addr_.sun_path, stats_socket_path_.c_str()); data/oomd-0.4.0/src/oomd/StatsTest.cpp:213:5: [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(serv_addr_.sun_path, socket_path.c_str()); data/oomd-0.4.0/src/oomd/util/FixtureTest.cpp:30:25: [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. auto stream = ::popen(cmd.c_str(), "r"); data/oomd-0.4.0/src/oomd/Log.cpp:83: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. bool inline_logging = std::getenv("INLINE_LOGGING") ? true : false; data/oomd-0.4.0/src/oomd/Main.cpp:263:15: [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 ((c = getopt_long( data/oomd-0.4.0/src/oomd/util/Fixture.cpp:60: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. if (std::getenv("TMPDIR") != nullptr) { data/oomd-0.4.0/src/oomd/util/Fixture.cpp:61:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return std::getenv("TMPDIR"); data/oomd-0.4.0/src/oomd/util/Fixture.cpp:62:19: [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. } else if (std::getenv("TMP") != nullptr) { data/oomd-0.4.0/src/oomd/util/Fixture.cpp:63:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return std::getenv("TMP"); data/oomd-0.4.0/src/oomd/util/Fixture.cpp:64:19: [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. } else if (std::getenv("TEMP") != nullptr) { data/oomd-0.4.0/src/oomd/util/Fixture.cpp:65:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return std::getenv("TEMP"); data/oomd-0.4.0/src/oomd/util/Fixture.cpp:66:19: [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. } else if (std::getenv("TEMPDIR") != nullptr) { data/oomd-0.4.0/src/oomd/util/Fixture.cpp:67:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return std::getenv("TEMPDIR"); data/oomd-0.4.0/src/oomd/CgroupContext.cpp:27:30: [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). cgroup_dir_(Fs::DirFd::open(cgroup.absolutePath())), data/oomd-0.4.0/src/oomd/Log.cpp:76:19: [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 kmsg_fd = ::open(kmsg_path.c_str(), O_WRONLY); data/oomd-0.4.0/src/oomd/LogTest.cpp:57:16: [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(&outfile[0]); data/oomd-0.4.0/src/oomd/Main.cpp:203:18: [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 lockfd = ::open(lockfile.c_str(), O_CREAT, S_IRUSR | S_IWUSR); data/oomd-0.4.0/src/oomd/Oomd.cpp:93: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[1024]; data/oomd-0.4.0/src/oomd/Oomd.cpp:118: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[1024]; data/oomd-0.4.0/src/oomd/Oomd.cpp:168: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[1024]; data/oomd-0.4.0/src/oomd/Oomd.cpp:279: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[4096] __attribute__((aligned(__alignof__(struct inotify_event)))); data/oomd-0.4.0/src/oomd/Oomd.cpp:320: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[1024]; data/oomd-0.4.0/src/oomd/util/Fixture.cpp:123: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). auto fd = ::open(path.c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0666); data/oomd-0.4.0/src/oomd/util/FixtureTest.cpp:98:14: [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(filepath.c_str(), O_RDONLY); data/oomd-0.4.0/src/oomd/util/FixtureTest.cpp:107: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). fd = ::open(filepath.c_str(), O_RDONLY); data/oomd-0.4.0/src/oomd/util/FixtureTest.cpp:143:14: [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(filepath.c_str(), O_RDONLY); data/oomd-0.4.0/src/oomd/util/Fs.cpp:66: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). Fs::Fd Fs::Fd::open(const std::string& path, bool read_only) { data/oomd-0.4.0/src/oomd/util/Fs.cpp:68: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). return Fd(::open(path.c_str(), flags)); data/oomd-0.4.0/src/oomd/util/Fs.cpp:91:22: [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). Fs::DirFd Fs::DirFd::open(const std::string& path) { data/oomd-0.4.0/src/oomd/util/Fs.cpp:92:18: [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). return DirFd(::open(path.c_str(), O_RDONLY | O_DIRECTORY)); data/oomd-0.4.0/src/oomd/util/Fs.cpp:517: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 name[256] = {0}; data/oomd-0.4.0/src/oomd/util/Fs.cpp:535: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 name[256] = {0}; data/oomd-0.4.0/src/oomd/util/Fs.cpp:618: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[1024]; data/oomd-0.4.0/src/oomd/util/Fs.cpp:633:30: [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). writeControlFileAt(Fs::Fd::open(path + "/" + kMemHighFile, false), val_str); data/oomd-0.4.0/src/oomd/util/Fs.cpp:647: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). Fs::Fd::open(path + "/" + kMemHighTmpFile, false), val_str); data/oomd-0.4.0/src/oomd/util/Fs.h:83: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). static Fd open(const std::string& path, bool read_only = true); data/oomd-0.4.0/src/oomd/util/Fs.h:122:18: [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). static DirFd open(const std::string& path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:145:25: [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). auto dir = Fs::DirFd::open(fixture_.fsDataDir() + "/dir1"); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:155:25: [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). auto dir = Fs::DirFd::open(fixture_.fsDataDir()); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:166:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:176:26: [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). auto dir2 = Fs::DirFd::open(path2); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:185:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:192:26: [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). auto dir2 = Fs::DirFd::open(path2); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:202:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:211:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:220:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:229:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:238:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:247:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:256:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:265:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:281:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:295:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:307:26: [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). auto dir2 = Fs::DirFd::open(path2); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:319:26: [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). auto dir3 = Fs::DirFd::open(path3); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:333:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:345:26: [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). auto dir2 = Fs::DirFd::open(path2); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:379:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:400:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:413:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:484:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:497:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/util/FsTest.cpp:510:25: [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). auto dir = Fs::DirFd::open(path); data/oomd-0.4.0/src/oomd/Main.cpp:298:58: [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 (parse_error || interval < 1 || parsed_len != strlen(optarg)) { data/oomd-0.4.0/src/oomd/Oomd.cpp:282:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int len = ::read(fd, buf, sizeof(buf)); data/oomd-0.4.0/src/oomd/Oomd.cpp:336:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = ::read(fd, &expired, sizeof(expired)); data/oomd-0.4.0/src/oomd/Stats.cpp:179:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int res = ::read(sockfd, &byte_buf, 1); data/oomd-0.4.0/src/oomd/Stats.cpp:220:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (Util::writeFull(sockfd, ret.c_str(), strlen(ret.c_str())) < 0) { data/oomd-0.4.0/src/oomd/StatsClient.cpp:154:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (Util::writeFull(sockfd, msg.c_str(), strlen(msg.c_str())) < 0) { data/oomd-0.4.0/src/oomd/StatsTest.cpp:225:52: [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 res = Util::writeFull(sockfd, msg.c_str(), strlen(msg.c_str())); data/oomd-0.4.0/src/oomd/util/Fs.cpp:217:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read; data/oomd-0.4.0/src/oomd/util/Fs.cpp:220:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read > 0 && line[read - 1] == '\n') { data/oomd-0.4.0/src/oomd/util/Fs.cpp:540:15: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. int ret = sscanf(line.c_str(), "%255s %" SCNu64 "\n", name, &val); data/oomd-0.4.0/src/oomd/util/Util.cpp:197:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return wrapFull(::read, fd, msg_buf, count); ANALYSIS SUMMARY: Hits = 76 Lines analyzed = 15432 in approximately 0.47 seconds (33007 lines/second) Physical Source Lines of Code (SLOC) = 10532 Hits@level = [0] 3 [1] 11 [2] 50 [3] 10 [4] 4 [5] 1 Hits@level+ = [0+] 79 [1+] 76 [2+] 65 [3+] 15 [4+] 5 [5+] 1 Hits/KSLOC@level+ = [0+] 7.50095 [1+] 7.2161 [2+] 6.17167 [3+] 1.42423 [4+] 0.474744 [5+] 0.0949487 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.