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/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-base.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-base.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-legacy.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-legacy.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-libertine.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-libertine.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-snap.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/appid.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-icon-finder.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-base.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-base.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-legacy.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-libertine.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-snap.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-snap.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-info-desktop.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-info-desktop.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/glib-thread.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/glib-thread.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper-impl.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/info-watcher-zg.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/info-watcher-zg.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/info-watcher.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/info-watcher.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-base.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-posix.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-posix.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/lomiri-app-launch.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/lomiri-app-launch.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/oom.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/registry-impl.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/registry.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/registry.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/second-exec-core.c
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/second-exec-core.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/signal-unsubscriber.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/snapd-info.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/snapd-info.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/string-util.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/type-tagger.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/ual-tracepoint.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/utils-shared.c
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/utils.c
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/utils.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-base.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/app-store-snap.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-legacy.cpp
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-libertine.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/registry-impl.h
Examining data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-icon-finder.cpp
Examining data/lomiri-app-launch-0.0.90/lomiri-app-test/src/lomiri-app-test.cpp
Examining data/lomiri-app-launch-0.0.90/tests/app-store-legacy.cpp
Examining data/lomiri-app-launch-0.0.90/tests/application-icon-finder.cpp
Examining data/lomiri-app-launch-0.0.90/tests/application-info-desktop.cpp
Examining data/lomiri-app-launch-0.0.90/tests/data-spew.c
Examining data/lomiri-app-launch-0.0.90/tests/eventually-fixture.h
Examining data/lomiri-app-launch-0.0.90/tests/helper-handshake-test.cc
Examining data/lomiri-app-launch-0.0.90/tests/helper-test.cc
Examining data/lomiri-app-launch-0.0.90/tests/info-watcher-zg.cpp
Examining data/lomiri-app-launch-0.0.90/tests/jobs-base-test.cpp
Examining data/lomiri-app-launch-0.0.90/tests/libertine-service.h
Examining data/lomiri-app-launch-0.0.90/tests/libual-cpp-test.cc
Examining data/lomiri-app-launch-0.0.90/tests/libual-test.cc
Examining data/lomiri-app-launch-0.0.90/tests/list-apps.cpp
Examining data/lomiri-app-launch-0.0.90/tests/lomiri-app-launch-mock.c
Examining data/lomiri-app-launch-0.0.90/tests/lomiri-app-launch-mock.h
Examining data/lomiri-app-launch-0.0.90/tests/mir-mock.cpp
Examining data/lomiri-app-launch-0.0.90/tests/mir-mock.h
Examining data/lomiri-app-launch-0.0.90/tests/registry-mock.h
Examining data/lomiri-app-launch-0.0.90/tests/snapd-info-test.cpp
Examining data/lomiri-app-launch-0.0.90/tests/snapd-mock.h
Examining data/lomiri-app-launch-0.0.90/tests/socket-tool.c
Examining data/lomiri-app-launch-0.0.90/tests/spew-master.h
Examining data/lomiri-app-launch-0.0.90/tests/systemd-mock.h
Examining data/lomiri-app-launch-0.0.90/tests/test-directory.h
Examining data/lomiri-app-launch-0.0.90/tests/zg-mock.h
Examining data/lomiri-app-launch-0.0.90/tests/zg-test.cc
Examining data/lomiri-app-launch-0.0.90/tests/jobs-systemd.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-info.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-launch-appids.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-launch.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-list-pids.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-list.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-pid.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-stop.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-triplet.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-usage.c
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-app-watch.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-helper-list.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-helper-start.cpp
Examining data/lomiri-app-launch-0.0.90/tools/lomiri-helper-stop.cpp
Examining data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c
Examining data/lomiri-app-launch-0.0.90/utils/socket-demangler.c
Examining data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c

FINAL RESULTS:

data/lomiri-app-launch-0.0.90/lomiri-app-test/src/lomiri-app-test.cpp:75:10:  [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.
		return execvp(argv[1], argv + 1);
data/lomiri-app-launch-0.0.90/lomiri-app-test/src/lomiri-app-test.cpp:122:10:  [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.
		return execvp(argv[1], argv + 1);
data/lomiri-app-launch-0.0.90/utils/socket-demangler.c:127:9:  [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.
	return execvp(argv[1], argv + 1);
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:121:10:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
		return execv(exectool[0], exectool);
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:243:9:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	return execv(apparray[0], apparray);
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-legacy.cpp:150: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.
    auto snappath = getenv("SNAP");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-legacy.cpp:158:34:  [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* legacyexec = getenv("LOMIRI_APP_LAUNCH_SNAP_LEGACY_EXEC");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-info-desktop.cpp:287:36:  [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.
        auto xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper.cpp:140: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.
    auto csnapenv = getenv("SNAP");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper.cpp:155:34:  [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* chelperenv = getenv("LOMIRI_APP_LAUNCH_HELPER_HELPER");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper.cpp:464: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.
    auto cenv = getenv("LOMIRI_APP_LAUNCH_HELPER_EXECTOOL_SETEXEC_SOCKET");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-base.h:121:78:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        std::function<std::list<std::pair<std::string, std::string>>(void)>& getenv) = 0;
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-posix.cpp:133: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.
    auto cvalue = getenv(envname.c_str());
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-posix.cpp:165:74:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    std::function<std::list<std::pair<std::string, std::string>>(void)>& getenv)
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-posix.cpp:199:20:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        auto env = getenv();
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-posix.h:53:78:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        std::function<std::list<std::pair<std::string, std::string>>(void)>& getenv) override;
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp:120:25:  [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.
    auto gcgroup_root = getenv("LOMIRI_APP_LAUNCH_SYSTEMD_CGROUP_ROOT");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp:132:9:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    if (getenv("LOMIRI_APP_LAUNCH_SYSTEMD_NO_RESET") != nullptr)
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp:520: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.
    auto cvalue = getenv(envname.c_str());
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp:552:74:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    std::function<std::list<std::pair<std::string, std::string>>(void)>& getenv)
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp:589:20:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        auto env = getenv();
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp:857:18:  [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.
    auto cpath = getenv("LOMIRI_APP_LAUNCH_SYSTEMD_PATH");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.h:53:78:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        std::function<std::list<std::pair<std::string, std::string>>(void)>& getenv) override;
data/lomiri-app-launch-0.0.90/tests/eventually-fixture.h:50:34:  [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.
            auto eventuallyenv = getenv("EVENTUALLY_TIMEOUT");
data/lomiri-app-launch-0.0.90/tests/jobs-systemd.cpp:270:84:  [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.
        units.begin()->environment.find(std::string{"DBUS_SESSION_BUS_ADDRESS="} + getenv("DBUS_SESSION_BUS_ADDRESS")));
data/lomiri-app-launch-0.0.90/tests/socket-tool.c:9: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 * fdstr = getenv("MIR_SOCKET");
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:77:2:  [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(time(NULL));
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:127: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("G_MESSAGES_DEBUG") != NULL) {
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:167:15:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	int debug = (getenv("G_MESSAGES_DEBUG") != NULL);
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:180: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("LOMIRI_APP_LAUNCH_DEMANGLE_PATH") != NULL &&
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:181:4:  [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.
			getenv("LOMIRI_APP_LAUNCH_DEMANGLE_NAME") != NULL) {
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:182:28:  [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.
		apparray[currentparam] = getenv("LOMIRI_APP_LAUNCH_DEMANGLER");
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-icon-finder.cpp:283:29:  [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).
                size = std::atoi(match[1].str().c_str());
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-icon-finder.cpp:298:33:  [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).
                    size = std::atoi(scalablewith[1].str().c_str());
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-base.cpp:911:47:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    auto score = static_cast<oom::Score>(std::atoi(content));
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-base.cpp:965:45:  [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).
    ResourcePtr<FILE*, void (*)(FILE*)> adj(fopen(path.c_str(), "w"), [](FILE* fp) {
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/jobs-systemd.cpp:1107:29:  [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).
            auto pid = std::atoi(pidline);
data/lomiri-app-launch-0.0.90/tests/eventually-fixture.h:53:61:  [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).
                _eventuallyTime = std::chrono::seconds{std::atoi(eventuallyenv)};
data/lomiri-app-launch-0.0.90/tests/libual-cpp-test.cc:1338: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).
    int mirfd = open(SESSION_TEMP_FILE, 0);
data/lomiri-app-launch-0.0.90/tests/libual-cpp-test.cc:1438: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 readbuf[2048] = {0};
data/lomiri-app-launch-0.0.90/tests/libual-test.cc:865: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).
    int mirfd = open(SESSION_TEMP_FILE, 0);
data/lomiri-app-launch-0.0.90/tests/libual-test.cc:963: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 readbuf[2048] = {0};
data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c:40: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 pidval = atoi(argv[1]);
data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c:48: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 oomval = atoi(argv[2]);
data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c:56: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 pidpath[32];
data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c:59: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).
	int piddir = open(pidpath, O_RDONLY | O_DIRECTORY);
data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c:96: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 oomstring[32];
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:78: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 socketname[SOCKETNAME_SIZE] = {0};
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:173: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 readbuf[PARAMS_SIZE] = {0};
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:176: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 * apparray[PARAMS_COUNT] = {0};
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-legacy.cpp:78:14:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    if (std::equal(snappyDesktopPath.begin(), snappyDesktopPath.end(), _basedir.begin()))
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-impl-snap.cpp:109:71:  [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).
                                                    iconvalue.get() + strlen(prefix) - 1);
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/application-info-desktop.cpp:208:13:  [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(keyval.get()[i]) != 0)
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper.cpp:492:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(socketaddr.sun_path, cenv, sizeof(socketaddr.sun_path) - 1);
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/helper.cpp:503: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).
        int writesize = write(sock.fd, citem, strlen(citem) + 1);
data/lomiri-app-launch-0.0.90/liblomiri-app-launch/second-exec-core.c:165: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).
	GString * str = g_string_sized_new(strlen(data->appid) + 2); /* base case, we just need a / and a null */
data/lomiri-app-launch-0.0.90/tests/libual-cpp-test.cc:1337:66:  [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).
    ASSERT_TRUE(g_file_set_contents(SESSION_TEMP_FILE, filedata, strlen(filedata), nullptr) == TRUE);
data/lomiri-app-launch-0.0.90/tests/libual-cpp-test.cc:1422:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(socketaddr.sun_path, socketname.c_str(), sizeof(socketaddr.sun_path) - 1);
data/lomiri-app-launch-0.0.90/tests/libual-cpp-test.cc:1441:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((thisread = read(readsocket, readbuf + amountread, 2048 - amountread)) > 0)
data/lomiri-app-launch-0.0.90/tests/libual-cpp-test.cc:1470: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).
                startvar = startvar + strlen(startvar) + 1;
data/lomiri-app-launch-0.0.90/tests/libual-test.cc:864:66:  [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).
    ASSERT_TRUE(g_file_set_contents(SESSION_TEMP_FILE, filedata, strlen(filedata), nullptr) == TRUE);
data/lomiri-app-launch-0.0.90/tests/libual-test.cc:947:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(socketaddr.sun_path, socketname.c_str(), sizeof(socketaddr.sun_path) - 1);
data/lomiri-app-launch-0.0.90/tests/libual-test.cc:966:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((thisread = read(readsocket, readbuf + amountread, 2048 - amountread)) > 0)
data/lomiri-app-launch-0.0.90/tests/libual-test.cc:995: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).
                startvar = startvar + strlen(startvar) + 1;
data/lomiri-app-launch-0.0.90/tests/socket-tool.c:23:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while (read(fdnum, &inchar, 1) == 1)
data/lomiri-app-launch-0.0.90/tools/lomiri-app-usage.c:72:13:  [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).
		appurl += strlen("application://");
data/lomiri-app-launch-0.0.90/tools/lomiri-app-usage.c:82:32:  [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).
		maxappname = MAX(maxappname, strlen(appurl));
data/lomiri-app-launch-0.0.90/tools/lomiri-app-usage.c:92:35:  [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).
		gint spaceneeded = maxappname - strlen(usage->name);
data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c:99:43:  [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 writesize = write(adj, oomstring, strlen(oomstring));
data/lomiri-app-launch-0.0.90/utils/oom-adjust-setuid-helper.c:105: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).
	if (writesize == strlen(oomstring))
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:90:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(socketaddr.sun_path, socketname, sizeof(socketaddr.sun_path) - 1);
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:133:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((thisread = read(readsocket, readbuf + amountread, PARAMS_SIZE - amountread)) > 0) {
data/lomiri-app-launch-0.0.90/utils/systemd-helper-helper.c:218: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).
			startvar = startvar + strlen(startvar) + 1;

ANALYSIS SUMMARY:

Hits = 73
Lines analyzed = 21945 in approximately 0.65 seconds (33680 lines/second)
Physical Source Lines of Code (SLOC) = 14535
Hits@level = [0]  34 [1]  23 [2]  18 [3]  27 [4]   5 [5]   0
Hits@level+ = [0+] 107 [1+]  73 [2+]  50 [3+]  32 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 7.36154 [1+] 5.02236 [2+] 3.43997 [3+] 2.20158 [4+] 0.343997 [5+]   0
Symlinks skipped = 3 (--allowlink overrides but see doc for security issue)
Dot directories skipped = 3 (--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.