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/icecc-1.3.1/client/arg.cpp
Examining data/icecc-1.3.1/client/argv.c
Examining data/icecc-1.3.1/client/argv.h
Examining data/icecc-1.3.1/client/client.h
Examining data/icecc-1.3.1/client/cpp.cpp
Examining data/icecc-1.3.1/client/local.cpp
Examining data/icecc-1.3.1/client/main.cpp
Examining data/icecc-1.3.1/client/md5.c
Examining data/icecc-1.3.1/client/md5.h
Examining data/icecc-1.3.1/client/remote.cpp
Examining data/icecc-1.3.1/client/safeguard.cpp
Examining data/icecc-1.3.1/client/util.cpp
Examining data/icecc-1.3.1/client/util.h
Examining data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp
Examining data/icecc-1.3.1/daemon/environment.cpp
Examining data/icecc-1.3.1/daemon/environment.h
Examining data/icecc-1.3.1/daemon/file_util.cpp
Examining data/icecc-1.3.1/daemon/file_util.h
Examining data/icecc-1.3.1/daemon/load.cpp
Examining data/icecc-1.3.1/daemon/load.h
Examining data/icecc-1.3.1/daemon/main.cpp
Examining data/icecc-1.3.1/daemon/serve.cpp
Examining data/icecc-1.3.1/daemon/serve.h
Examining data/icecc-1.3.1/daemon/workit.cpp
Examining data/icecc-1.3.1/daemon/workit.h
Examining data/icecc-1.3.1/scheduler/compileserver.cpp
Examining data/icecc-1.3.1/scheduler/compileserver.h
Examining data/icecc-1.3.1/scheduler/job.cpp
Examining data/icecc-1.3.1/scheduler/job.h
Examining data/icecc-1.3.1/scheduler/jobstat.cpp
Examining data/icecc-1.3.1/scheduler/jobstat.h
Examining data/icecc-1.3.1/scheduler/scheduler.cpp
Examining data/icecc-1.3.1/scheduler/scheduler.h
Examining data/icecc-1.3.1/services/comm.cpp
Examining data/icecc-1.3.1/services/comm.h
Examining data/icecc-1.3.1/services/exitcode.cpp
Examining data/icecc-1.3.1/services/exitcode.h
Examining data/icecc-1.3.1/services/gcc.cpp
Examining data/icecc-1.3.1/services/getifaddrs.cpp
Examining data/icecc-1.3.1/services/getifaddrs.h
Examining data/icecc-1.3.1/services/job.cpp
Examining data/icecc-1.3.1/services/job.h
Examining data/icecc-1.3.1/services/logging.cpp
Examining data/icecc-1.3.1/services/logging.h
Examining data/icecc-1.3.1/services/ncpus.c
Examining data/icecc-1.3.1/services/ncpus.h
Examining data/icecc-1.3.1/services/platform.cpp
Examining data/icecc-1.3.1/services/platform.h
Examining data/icecc-1.3.1/services/tempfile.c
Examining data/icecc-1.3.1/services/tempfile.h
Examining data/icecc-1.3.1/services/util.cpp
Examining data/icecc-1.3.1/services/util.h
Examining data/icecc-1.3.1/tests/clangplugin.cpp
Examining data/icecc-1.3.1/tests/clangplugintest.cpp
Examining data/icecc-1.3.1/tests/countermacro.c
Examining data/icecc-1.3.1/tests/debug.cpp
Examining data/icecc-1.3.1/tests/debug/debug2.cpp
Examining data/icecc-1.3.1/tests/fsanitize.cpp
Examining data/icecc-1.3.1/tests/includes-without.cpp
Examining data/icecc-1.3.1/tests/includes.cpp
Examining data/icecc-1.3.1/tests/includes.h
Examining data/icecc-1.3.1/tests/make.h
Examining data/icecc-1.3.1/tests/make1.cpp
Examining data/icecc-1.3.1/tests/make10.cpp
Examining data/icecc-1.3.1/tests/make2.cpp
Examining data/icecc-1.3.1/tests/make3.cpp
Examining data/icecc-1.3.1/tests/make4.cpp
Examining data/icecc-1.3.1/tests/make5.cpp
Examining data/icecc-1.3.1/tests/make6.cpp
Examining data/icecc-1.3.1/tests/make7.cpp
Examining data/icecc-1.3.1/tests/make8.cpp
Examining data/icecc-1.3.1/tests/make9.cpp
Examining data/icecc-1.3.1/tests/messages.cpp
Examining data/icecc-1.3.1/tests/messages.h
Examining data/icecc-1.3.1/tests/plain.c
Examining data/icecc-1.3.1/tests/plain.cpp
Examining data/icecc-1.3.1/tests/rawliterals.cpp
Examining data/icecc-1.3.1/tests/syntaxerror.cpp
Examining data/icecc-1.3.1/tests/testdefine.cpp
Examining data/icecc-1.3.1/tests/testfunc.cpp
Examining data/icecc-1.3.1/tests/testmainfunc.cpp
Examining data/icecc-1.3.1/tests/true.cpp
Examining data/icecc-1.3.1/tests/unusedmacro.cpp
Examining data/icecc-1.3.1/tests/warninginmacro.cpp
Examining data/icecc-1.3.1/unittests/args.cpp

FINAL RESULTS:

data/icecc-1.3.1/client/util.cpp:346:21:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    const int ret = readlink(file.c_str(), buf, sizeof(buf) - 1);
data/icecc-1.3.1/daemon/environment.cpp:184:9:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    if (chown(basedir.c_str(), user_uid, user_gid) || chmod(basedir.c_str(), 0775)) {
data/icecc-1.3.1/daemon/environment.cpp:184:55:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if (chown(basedir.c_str(), user_uid, user_gid) || chmod(basedir.c_str(), 0775)) {
data/icecc-1.3.1/daemon/environment.cpp:230:9:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    if (chown(nativedir.c_str(), user_uid, user_gid) ||
data/icecc-1.3.1/daemon/environment.cpp:231:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
            chmod(nativedir.c_str(), 0775)) {
data/icecc-1.3.1/daemon/environment.cpp:433:9:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    if (chown(dirname.c_str(), user_uid, user_gid) || chmod(dirname.c_str(), 0770)) {
data/icecc-1.3.1/daemon/environment.cpp:433:55:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if (chown(dirname.c_str(), user_uid, user_gid) || chmod(dirname.c_str(), 0770)) {
data/icecc-1.3.1/daemon/environment.cpp:445:9:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    if (chown(dirname.c_str(), user_uid, user_gid) || chmod(dirname.c_str(), 0770)) {
data/icecc-1.3.1/daemon/environment.cpp:445:55:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if (chown(dirname.c_str(), user_uid, user_gid) || chmod(dirname.c_str(), 0770)) {
data/icecc-1.3.1/daemon/environment.cpp:593:19:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    ignore_result(chown((dirname + "/tmp").c_str(), user_uid, user_gid));
data/icecc-1.3.1/daemon/environment.cpp:594:5:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    chmod((dirname + "/tmp").c_str(), 01775);
data/icecc-1.3.1/daemon/main.cpp:2435:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
            chmod("/var/log/icecc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
data/icecc-1.3.1/daemon/main.cpp:2436:27:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
            ignore_result(chown("/var/log/icecc", d.user_uid, d.user_gid));
data/icecc-1.3.1/daemon/main.cpp:2441:9:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
        chmod("/var/run/icecc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
data/icecc-1.3.1/daemon/main.cpp:2442:23:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
        ignore_result(chown("/var/run/icecc", d.user_uid, d.user_gid));
data/icecc-1.3.1/scheduler/scheduler.cpp:2050:31:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
                    if (-1 == chmod("/var/log/icecc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)){
data/icecc-1.3.1/scheduler/scheduler.cpp:2054:31:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
                    if (-1 == chown("/var/log/icecc", user_uid, user_gid)){
data/icecc-1.3.1/client/arg.cpp:278:13:  [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(arg.c_str(), R_OK) == 0) {
data/icecc-1.3.1/client/arg.cpp:626:21:  [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(file.c_str(), R_OK) == 0) {
data/icecc-1.3.1/client/arg.cpp:646:33:  [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(file.c_str(), R_OK) == 0) {
data/icecc-1.3.1/client/cpp.cpp:127:25:  [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(), R_OK) < 0 && access((p + ".gch").c_str(), R_OK) == 0) {
data/icecc-1.3.1/client/cpp.cpp:127:56:  [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(), R_OK) < 0 && access((p + ".gch").c_str(), R_OK) == 0) {
data/icecc-1.3.1/client/cpp.cpp:141:25:  [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(), R_OK) == 0) {
data/icecc-1.3.1/client/cpp.cpp:201:5:  [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.
    execv(argv[0], argv);
data/icecc-1.3.1/client/local.cpp:313: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.
        execv(argv[0], &argv[0]);
data/icecc-1.3.1/client/main.cpp:165:20:  [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.
        } else if( access( args[0], R_OK ) == 0 && access( args[ 0 ], X_OK ) != 0 ) {
data/icecc-1.3.1/client/main.cpp:165:52:  [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.
        } else if( access( args[0], R_OK ) == 0 && access( args[ 0 ], X_OK ) != 0 ) {
data/icecc-1.3.1/client/main.cpp:193:5:  [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.
    execv(argv[0], argv.data());
data/icecc-1.3.1/client/main.cpp:498:37:  [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 (native.empty() || ::access(native.c_str(), R_OK) < 0) {
data/icecc-1.3.1/client/main.cpp:517:19:  [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(it->second.c_str(), R_OK) < 0) {
data/icecc-1.3.1/client/remote.cpp:128:15:  [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(version.c_str(), R_OK) < 0) {
data/icecc-1.3.1/client/util.cpp:375:15:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    FILE *f = popen(command.c_str(), "r");
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:68: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(args[0], argv[0]);
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:146:5:  [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.
    execv(args[0], args);
data/icecc-1.3.1/daemon/environment.cpp:93:13:  [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(string(targetdir + "/" + dirname + "/usr/bin/as").c_str(), X_OK) == 0) {
data/icecc-1.3.1/daemon/environment.cpp:121:5:  [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.
    execv(argv[0], const_cast<char * const *>(argv));
data/icecc-1.3.1/daemon/environment.cpp:169:9:  [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(basedir.c_str(), R_OK) == 0 && !cleanup_directory(basedir)) {
data/icecc-1.3.1/daemon/environment.cpp:640:5:  [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.
    execv(argv[0], argv);
data/icecc-1.3.1/daemon/environment.cpp:745:11:  [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(string(dirname + "/bin/true").c_str(), X_OK) < 0) {
data/icecc-1.3.1/daemon/environment.cpp:769:5:  [4] (shell) execl:
  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.
    execl("bin/true", "bin/true", (void*)NULL);
data/icecc-1.3.1/daemon/main.cpp:1376:43:  [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 (env.filetimes != filetimes || access(env.name.c_str(), R_OK) != 0) {
data/icecc-1.3.1/daemon/serve.cpp:183:19:  [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(string(dirname + "/usr/bin/as").c_str(), X_OK) < 0) {
data/icecc-1.3.1/daemon/serve.cpp:197:15:  [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_TMP + 1, W_OK) < 0) {
data/icecc-1.3.1/daemon/workit.cpp:313:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            sprintf(buffer, "-fdebug-prefix-map=%s/=/", tmp_root.c_str());
data/icecc-1.3.1/daemon/workit.cpp:390: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.
        execv(argv[0], const_cast<char * const*>(argv));    // no return
data/icecc-1.3.1/scheduler/scheduler.cpp:333:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buffer, "Name:%s\n", cs->nodeName().c_str());
data/icecc-1.3.1/scheduler/scheduler.cpp:335:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buffer, "IP:%s\n", cs->name.c_str());
data/icecc-1.3.1/scheduler/scheduler.cpp:339:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buffer, "NoRemote:%s\n", cs->noRemote() ? "true" : "false");
data/icecc-1.3.1/scheduler/scheduler.cpp:341:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buffer, "Platform:%s\n", cs->hostPlatform().c_str());
data/icecc-1.3.1/scheduler/scheduler.cpp:345:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buffer, "Features:%s\n", supported_features_to_string(cs->supportedFeatures()).c_str());
data/icecc-1.3.1/scheduler/scheduler.cpp:1441:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            sprintf(buffer, " (%s:%d) ", (*it)->name.c_str(), (*it)->remotePort());
data/icecc-1.3.1/client/local.cpp:53: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.
    string path = ::getenv("PATH");
data/icecc-1.3.1/client/local.cpp:131: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.
        if (const char *env = getenv("ICECC_CC")) {
data/icecc-1.3.1/client/local.cpp:137: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.
        if (const char *env = getenv("ICECC_CXX")) {
data/icecc-1.3.1/client/local.cpp:171:40:  [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 (const char *rewrite_includes = getenv("ICECC_REMOTE_CPP")) {
data/icecc-1.3.1/client/local.cpp:184:44:  [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 (const char *rewrite_includes = getenv("ICECC_CLANG_REMOTE_CPP")) {
data/icecc-1.3.1/client/main.cpp:187:39:  [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( const char* env_compression = getenv( "ICECC_ENV_COMPRESSION" )) {
data/icecc-1.3.1/client/main.cpp:203: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("ICECC_TEST_SOCKET") == NULL) {
data/icecc-1.3.1/client/main.cpp:211: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.
        if (!local_daemon && getenv("HOME")) {
data/icecc-1.3.1/client/main.cpp:212:27:  [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.
            string path = getenv("HOME");
data/icecc-1.3.1/client/main.cpp:221:47:  [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.
        local_daemon = Service::createChannel(getenv("ICECC_TEST_SOCKET"));
data/icecc-1.3.1/client/main.cpp:290: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 *env = getenv("ICECC_DEBUG");
data/icecc-1.3.1/client/main.cpp:307: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.
    if (const char *logfileEnv = getenv("ICECC_LOGFILE")) {
data/icecc-1.3.1/client/main.cpp:400: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.
    const char *icecc = getenv("ICECC");
data/icecc-1.3.1/client/main.cpp:428:37:  [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 (const char *extrafilesenv = getenv("ICECC_EXTRAFILES")) {
data/icecc-1.3.1/client/main.cpp:461:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        if (getenv("ICECC_VERSION")) {     // if set, use it, otherwise take default
data/icecc-1.3.1/client/main.cpp:480:53:  [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( const char* icecc_env_compression = getenv( "ICECC_ENV_COMPRESSION" ))
data/icecc-1.3.1/client/main.cpp:530:29:  [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 *s = getenv("ICECC_REPEAT_RATE");
data/icecc-1.3.1/client/remote.cpp:83: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.
    string icecc_version = getenv("ICECC_VERSION");
data/icecc-1.3.1/client/remote.cpp:712:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        if (getenv("ICECC_TEST_REMOTEBUILD") && usecs->port != 0 )
data/icecc-1.3.1/client/remote.cpp:783:45:  [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 (const char* icecc_env_compression = getenv( "ICECC_ENV_COMPRESSION" )) {
data/icecc-1.3.1/client/remote.cpp:794:5:  [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(0) + getpid());
data/icecc-1.3.1/client/remote.cpp:821: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 *preferred_host = getenv("ICECC_PREFERRED_HOST");
data/icecc-1.3.1/client/safeguard.cpp:46: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 *env = getenv(dcc_safeguard_name);
data/icecc-1.3.1/client/util.cpp:241: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.
    const char* term_env = getenv("TERM");
data/icecc-1.3.1/client/util.cpp:255:47:  [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 (const char* icecc_color_diagnostics = getenv("ICECC_COLOR_DIAGNOSTICS")) {
data/icecc-1.3.1/client/util.cpp:265: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.
    if (const char *gcc_colors = getenv("GCC_COLORS")) {
data/icecc-1.3.1/client/util.cpp:280: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("ICECC_COLOR_DIAGNOSTICS") != NULL)
data/icecc-1.3.1/client/util.cpp:283: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("EMACS")) {
data/icecc-1.3.1/client/util.cpp:315: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.
    return getenv("ICECC_IGNORE_UNVERIFIED");
data/icecc-1.3.1/client/util.cpp:334:40:  [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 (const char* caret_workaround = getenv("ICECC_CARET_WORKAROUND"))
data/icecc-1.3.1/daemon/environment.cpp:683:9:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
    if (chroot(dirname.c_str()) < 0) {
data/icecc-1.3.1/daemon/environment.cpp:702:13:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
        if (chroot(dirname.c_str()) < 0) {
data/icecc-1.3.1/daemon/main.cpp:661: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("ICECC_TEST_SOCKET") == NULL) {
data/icecc-1.3.1/daemon/main.cpp:680: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.
            if( getenv( "HOME" )) {
data/icecc-1.3.1/daemon/main.cpp:681:38:  [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.
                string socket_path = getenv("HOME");
data/icecc-1.3.1/daemon/main.cpp:697: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.
        string test_socket = getenv("ICECC_TEST_SOCKET");
data/icecc-1.3.1/daemon/main.cpp:774: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( "ICECC_TESTS" ) != NULL && nodename == "remoteice2" )
data/icecc-1.3.1/daemon/main.cpp:828: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.
    static bool fast_reconnect = getenv( "ICECC_TESTS" ) != NULL;
data/icecc-1.3.1/daemon/main.cpp:2227:5:  [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(0) + getpid());
data/icecc-1.3.1/daemon/main.cpp:2256:23:  [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.
        const int c = getopt_long(argc, argv, "N:n:m:l:s:hvdb:u:i:p:", long_options, &option_index);
data/icecc-1.3.1/scheduler/scheduler.cpp:616:21:  [3] (random) random:
  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.
                if( random() % eligible_count == 0 )
data/icecc-1.3.1/scheduler/scheduler.cpp:836:14:  [3] (random) random:
  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.
        if ((random() % 400) < 0) {
data/icecc-1.3.1/scheduler/scheduler.cpp:1948:23:  [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.
        const int c = getopt_long(argc, argv, "n:i:p:hl:vdru:", long_options, &option_index);
data/icecc-1.3.1/scheduler/scheduler.cpp:2114: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( "ICECC_FAKE_STARTTIME" ) != NULL )
data/icecc-1.3.1/services/comm.cpp:75: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.
    const char *level = getenv("ICECC_COMPRESSION");
data/icecc-1.3.1/services/comm.cpp:344:42:  [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( const char* icecc_slow_network = getenv( "ICECC_SLOW_NETWORK" ))
data/icecc-1.3.1/services/comm.cpp:1343: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.
        if( const char* env = getenv( "ICECC_TEST_SCHEDULER_PORTS" )) {
data/icecc-1.3.1/services/comm.cpp:1473:32:  [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.
        static bool in_tests = getenv( "ICECC_TESTS" ) != NULL;
data/icecc-1.3.1/services/comm.cpp:1547:27:  [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 *get = getenv("ICECC_SCHEDULER");
data/icecc-1.3.1/services/comm.cpp:1549: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.
            get = getenv("USE_SCHEDULER");
data/icecc-1.3.1/services/logging.cpp:123:44:  [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( const char* ccache_err_fd = getenv( "UNCACHED_ERR_FD" )) {
data/icecc-1.3.1/services/logging.cpp:175: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.
        if( const char* env = getenv( "ICECC_TEST_FLUSH_LOG_MARK" )) {
data/icecc-1.3.1/services/logging.cpp:184: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.
        if( const char* env = getenv( "ICECC_TEST_LOG_HEADER" )) {
data/icecc-1.3.1/client/argv.c:354:11:  [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).
      f = fopen (++filename, "r");
data/icecc-1.3.1/client/argv.c:401:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy (*argvp + i, file_argv, file_argc * sizeof (char *));
data/icecc-1.3.1/client/local.cpp:322:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buf[256];
data/icecc-1.3.1/client/local.cpp:349: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 buf[250];
data/icecc-1.3.1/client/main.cpp:531:28:  [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 rate = s ? atoi(s) : 0;
data/icecc-1.3.1/client/md5.c:54:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static const char *const test[7] = {
data/icecc-1.3.1/client/md5.c:211:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(xbuf, data, 64);
data/icecc-1.3.1/client/md5.c:366:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(pms->buf + offset, p, copy);
data/icecc-1.3.1/client/md5.c:384:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(pms->buf, p, left);
data/icecc-1.3.1/client/remote.cpp:258: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.
    unsigned char buffer[100000]; // some random but huge number
data/icecc-1.3.1/client/remote.cpp:322: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 obj_fd = open(tmp_file.c_str(), O_CREAT | O_TRUNC | O_WRONLY | O_LARGEFILE, 0666);
data/icecc-1.3.1/client/remote.cpp:439: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).
            int env_fd = open(version_file.c_str(), O_RDONLY);
data/icecc-1.3.1/client/remote.cpp:558: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).
            int cpp_fd = open(preproc_file, O_RDONLY);
data/icecc-1.3.1/client/remote.cpp:669:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *f = fopen(file.c_str(), "rb");
data/icecc-1.3.1/client/remote.cpp:692: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 digest_cache[33];
data/icecc-1.3.1/client/remote.cpp:695:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(digest_cache + di * 2, "%02x", digest[di]);
data/icecc-1.3.1/client/remote.cpp:870: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).
        int cpp_fd = open(preproc, O_WRONLY);
data/icecc-1.3.1/client/remote.cpp:897: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 rand_seed[400]; // "designed to be oversized" (Levi's)
data/icecc-1.3.1/client/remote.cpp:898:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(rand_seed, "-frandom-seed=%d", rand());
data/icecc-1.3.1/client/safeguard.cpp:50:37:  [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).
        if (!(dcc_safeguard_level = atoi(env))) {
data/icecc-1.3.1/client/safeguard.cpp:65: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 value[2] = { (char)(dcc_safeguard_level + step + '0'), '\0' };
data/icecc-1.3.1/client/util.cpp:152: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).
    plockfd = open(fname.c_str(), O_WRONLY | O_CREAT, 0666);
data/icecc-1.3.1/client/util.cpp:176:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buffer[12];
data/icecc-1.3.1/client/util.cpp:177:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "%ld", (long)getuid());
data/icecc-1.3.1/client/util.cpp:204: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 num[ 20 ];
data/icecc-1.3.1/client/util.cpp:205:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf( num, "%d", lock );
data/icecc-1.3.1/client/util.cpp:344:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[PATH_MAX];
data/icecc-1.3.1/client/util.cpp:383: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[1024];
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:78:9:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
        strcat(args[0], "clang");
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:80:9:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
        strcat(args[0], "g++.bin");
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:82:9:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
        strcat(args[0], "gcc.bin");
data/icecc-1.3.1/daemon/environment.cpp:338:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[1024];
data/icecc-1.3.1/daemon/load.cpp:165:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[256];
data/icecc-1.3.1/daemon/load.cpp:169: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).
        if ((fd = open("/proc/stat", O_RDONLY)) < 0) {
data/icecc-1.3.1/daemon/load.cpp:302:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[256];
data/icecc-1.3.1/daemon/load.cpp:306: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).
        if ((fd = open("/proc/meminfo", O_RDONLY)) < 0) {
data/icecc-1.3.1/daemon/main.cpp:2269: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).
                    int tnice = atoi(optarg);
data/icecc-1.3.1/daemon/main.cpp:2286:30:  [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 mb = atoi(optarg);
data/icecc-1.3.1/daemon/main.cpp:2340: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).
                max_processes = atoi(optarg);
data/icecc-1.3.1/daemon/main.cpp:2355:40:  [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).
                    d.scheduler_port = atoi( scheduler.substr( colon + 1 ).c_str());
data/icecc-1.3.1/daemon/main.cpp:2410: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).
                d.daemon_port = atoi(optarg);
data/icecc-1.3.1/daemon/main.cpp:2534: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).
    pidFile.open(pidFilePath.c_str());
data/icecc-1.3.1/daemon/serve.cpp:88: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).
        obj_fd = open(file.c_str(), O_RDONLY | O_LARGEFILE);
data/icecc-1.3.1/daemon/serve.cpp:96:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        unsigned char buffer[100000];
data/icecc-1.3.1/daemon/serve.cpp:211: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 prefix_output[32]; // 20 for 2^64 + 6 for "icecc-" + 1 for trailing NULL
data/icecc-1.3.1/daemon/serve.cpp:212:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(prefix_output, "icecc-%u", job_id);
data/icecc-1.3.1/daemon/workit.cpp:126: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[4096];
data/icecc-1.3.1/daemon/workit.cpp:301:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(buffer, "ggc-min-expand=%d", ggc_min_expand_heuristic(mem_limit));
data/icecc-1.3.1/daemon/workit.cpp:304:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(buffer, "ggc-min-heapsize=%d", ggc_min_heapsize_heuristic(mem_limit));
data/icecc-1.3.1/scheduler/compileserver.cpp:498:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&remote_addr.sin_addr.s_addr, host->h_addr_list[0], host->h_length);
data/icecc-1.3.1/scheduler/compileserver.cpp:573:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&remote_addr.sin_addr.s_addr, host->h_addr_list[0], host->h_length);
data/icecc-1.3.1/scheduler/scheduler.cpp:332: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[1000];
data/icecc-1.3.1/scheduler/scheduler.cpp:337:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buffer, "MaxJobs:%d\n", cs->maxJobs());
data/icecc-1.3.1/scheduler/scheduler.cpp:343:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buffer, "Version:%d\n", cs->maximum_remote_protocol);
data/icecc-1.3.1/scheduler/scheduler.cpp:347:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(buffer, "Speed:%f\n", server_speed(cs));
data/icecc-1.3.1/scheduler/scheduler.cpp:351:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "Load:%d\n", m->load);
data/icecc-1.3.1/scheduler/scheduler.cpp:353:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "LoadAvg1:%u\n", m->loadAvg1);
data/icecc-1.3.1/scheduler/scheduler.cpp:355:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "LoadAvg5:%u\n", m->loadAvg5);
data/icecc-1.3.1/scheduler/scheduler.cpp:357:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "LoadAvg10:%u\n", m->loadAvg10);
data/icecc-1.3.1/scheduler/scheduler.cpp:359:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "FreeMem:%u\n", m->freeMem);
data/icecc-1.3.1/scheduler/scheduler.cpp:362:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buffer, "Load:%u\n", cs->load());
data/icecc-1.3.1/scheduler/scheduler.cpp:1343: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[1000];
data/icecc-1.3.1/scheduler/scheduler.cpp:1440:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buffer[1000];
data/icecc-1.3.1/scheduler/scheduler.cpp:1444:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(buffer, "%.2f jobs=%d/%d load=%d", server_speed(*it),
data/icecc-1.3.1/scheduler/scheduler.cpp:1449:17:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
                sprintf(buffer, " busy installing since %ld s",  time(0) - (*it)->busyInstalling());
data/icecc-1.3.1/scheduler/scheduler.cpp:2005:34:  [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).
                scheduler_port = atoi(optarg);
data/icecc-1.3.1/scheduler/scheduler.cpp:2121: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).
    pidFile.open(pidFilePath.c_str());
data/icecc-1.3.1/scheduler/scheduler.cpp:2293:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buf[Broadcasts::BROAD_BUFLEN + 1];
data/icecc-1.3.1/services/comm.cpp:182:22:  [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 vers[4];
data/icecc-1.3.1/services/comm.cpp:184:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(vers, inbuf + intogo, 4);
data/icecc-1.3.1/services/comm.cpp:338:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(msgbuf + msgtogo, _buf, count);
data/icecc-1.3.1/services/comm.cpp:432:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(t_buf, inbuf + intogo, 4);
data/icecc-1.3.1/services/comm.cpp:669:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(msgbuf + msgtogo_old, &_olen, 4);
data/icecc-1.3.1/services/comm.cpp:754:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&remote_addr.sin_addr.s_addr, host->h_addr_list[0], host->h_length);
data/icecc-1.3.1/services/comm.cpp:920:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(addr, _a, _l);
data/icecc-1.3.1/services/comm.cpp:924:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buf[16384] = "";
data/icecc-1.3.1/services/comm.cpp:994:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        unsigned char vers[4] = {PROTOCOL_VERSION, 0, 0, 0};
data/icecc-1.3.1/services/comm.cpp:1323:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(msgbuf + msgtogo_old, &len, 4);
data/icecc-1.3.1/services/comm.cpp:1344:26:  [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).
            debugPort1 = atoi( env );
data/icecc-1.3.1/services/comm.cpp:1347:30:  [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).
                debugPort2 = atoi( env2 + 1 );
data/icecc-1.3.1/services/comm.cpp:1370:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buf + 4, &tmp_time, sizeof(uint64_t));
data/icecc-1.3.1/services/comm.cpp:1387:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buf + 4, &tmp_time_high, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1388:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buf + 4 + sizeof(uint32_t), &tmp_time_low, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1412:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&tmp_time_high, buf + 4, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1413:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(&tmp_time_low, buf + 4 + sizeof(uint32_t), sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1558:25:  [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).
                sport = atoi( scheduler.substr( colon + 1 ).c_str());
data/icecc-1.3.1/services/comm.cpp:1648:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf + 1, &tmp_version, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1649:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf + 1 + sizeof(uint32_t), &tmp_time, sizeof(uint64_t));
data/icecc-1.3.1/services/comm.cpp:1659:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf + 1, &tmp_version, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1660:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf + 1 + sizeof(uint32_t), &tmp_time, sizeof(uint64_t));
data/icecc-1.3.1/services/comm.cpp:1674:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf + 1, &tmp_version, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1675:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf + 1 + sizeof(uint32_t), &tmp_time_high, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1676:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buf + 1 + 2 * sizeof(uint32_t), &tmp_time_low, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1697:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&tmp_version, buf + 1, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1702:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&tmp_time, buf + 1 + sizeof(uint32_t), sizeof(uint64_t));
data/icecc-1.3.1/services/comm.cpp:1710:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&tmp_version, buf + 1, sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1715:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&tmp_time_high, buf + 1 + sizeof(uint32_t), sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1716:13:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
            memcpy(&tmp_time_low, buf + 1 + 2 * sizeof(uint32_t), sizeof(uint32_t));
data/icecc-1.3.1/services/comm.cpp:1732: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 buf2[BROAD_BUFLEN];
data/icecc-1.3.1/services/comm.cpp:1884: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 buf2[BROAD_BUFLEN];
data/icecc-1.3.1/services/getifaddrs.cpp:170:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char name[IF_NAMESIZE];
data/icecc-1.3.1/services/logging.cpp:107: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).
        logfile_file.open(filename.c_str(), fstream::out | fstream::app);
data/icecc-1.3.1/services/logging.cpp:112:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buf[PATH_MAX];
data/icecc-1.3.1/services/logging.cpp:124: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).
        output = ccache_stream( atoi( ccache_err_fd ));
data/icecc-1.3.1/services/logging.h:61:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[64];
data/icecc-1.3.1/services/tempfile.c:105: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 fd = open(tmpname, O_WRONLY | O_CREAT | O_EXCL, 0600);
data/icecc-1.3.1/tests/clangplugin.cpp:87: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 buf[ 20 ];
data/icecc-1.3.1/client/arg.cpp:55:33:  [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).
    return !strncmp(head, worm, strlen(head));
data/icecc-1.3.1/client/arg.cpp:338:56:  [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).
                       || !strncmp(a, "-ftime-report", strlen("-ftime-report"))
data/icecc-1.3.1/client/arg.cpp:624: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).
                string file = a + strlen(prefix);
data/icecc-1.3.1/client/argv.c:184:30:  [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).
  copybuf = (char *) malloc (strlen (input) + 1);
data/icecc-1.3.1/client/local.cpp:353:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            while ((r = read(pf[0], buf, sizeof(buf) - 1)) > 0) {
data/icecc-1.3.1/client/md5.c:71:57:  [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).
        md5_append(&state, (const md5_byte_t *)test[i], strlen(test[i]));
data/icecc-1.3.1/client/remote.cpp:150:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(suff);
data/icecc-1.3.1/client/remote.cpp:267:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            bytes = read(fd, buffer + offset, sizeof(buffer) - offset);
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:49:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int argv0len = strlen(argv[0]);
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:67:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    args[0] = new char[strlen(argv[0]) + 20];
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:114:61:  [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 (strncmp(argv[i + 1], "ggc-min-expand=", strlen("ggc-min-expand=")) == 0
data/icecc-1.3.1/compilerwrapper/compilerwrapper.cpp:115:70:  [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).
                        || strncmp(argv[i + 1], "ggc-min-heapsize=", strlen("ggc-min-heapsize=")) == 0) {
data/icecc-1.3.1/daemon/environment.cpp:341:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while (read(pipe, buf, 1023) < 0 && errno == EINTR) {}
data/icecc-1.3.1/daemon/file_util.cpp:154:23:  [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 path_len = strlen(path);
data/icecc-1.3.1/daemon/file_util.cpp:172:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            len = path_len + strlen(p->d_name) + 2;
data/icecc-1.3.1/daemon/load.cpp:185:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((n = read(fd, buf, sizeof(buf) - 1)) < 0 && errno == EINTR) {}
data/icecc-1.3.1/daemon/load.cpp:235:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (sscanf(b + strlen(key), ": %lu", &val) != 1) {
data/icecc-1.3.1/daemon/load.cpp:322:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((n = read(fd, buf, sizeof(buf) - 1)) < 0 && errno == EINTR) {}
data/icecc-1.3.1/daemon/main.cpp:398:49:  [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).
        ignore_result(write(STDERR_FILENO, msg, strlen( msg )));
data/icecc-1.3.1/daemon/main.cpp:669:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(myaddr.sun_path, default_socket.c_str() , sizeof(myaddr.sun_path) - 1);
data/icecc-1.3.1/daemon/main.cpp:677:25:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
            old_umask = umask(0);
data/icecc-1.3.1/daemon/main.cpp:683:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(myaddr.sun_path, socket_path.c_str(), sizeof(myaddr.sun_path) - 1);
data/icecc-1.3.1/daemon/main.cpp:698:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(myaddr.sun_path, test_socket.c_str(), sizeof(myaddr.sun_path) - 1);
data/icecc-1.3.1/daemon/main.cpp:712:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
            umask(old_umask);
data/icecc-1.3.1/daemon/main.cpp:719:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
        umask(old_umask);
data/icecc-1.3.1/daemon/main.cpp:1156:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t n = ::read(client->pipe_from_child, &resultByte, 1);
data/icecc-1.3.1/daemon/main.cpp:1591:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(client->pipe_from_child, job_stat, sizeof(job_stat)) == sizeof(job_stat)) {
data/icecc-1.3.1/daemon/main.cpp:2429:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(022);
data/icecc-1.3.1/daemon/serve.cpp:99:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ssize_t bytes = read(obj_fd, buffer, sizeof(buffer));
data/icecc-1.3.1/daemon/workit.cpp:418:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t n = ::read(main_sock[0], &resultByte, 1);
data/icecc-1.3.1/daemon/workit.cpp:623:33:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ssize_t bytes = read(sock_out[0], buffer, sizeof(buffer) - 1);
data/icecc-1.3.1/daemon/workit.cpp:637:33:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ssize_t bytes = read(sock_err[0], buffer, sizeof(buffer) - 1);
data/icecc-1.3.1/scheduler/scheduler.cpp:1857:49:  [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).
        ignore_result(write(STDERR_FILENO, msg, strlen( msg )));
data/icecc-1.3.1/services/comm.cpp:136:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t ret = read(fd, buf, count);
data/icecc-1.3.1/services/comm.cpp:860:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(remote_addr.sun_path, socket_path.c_str(), sizeof(remote_addr.sun_path) - 1);
data/icecc-1.3.1/services/comm.cpp:1362:33:  [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).
    const char length_netname = strlen(netname);
data/icecc-1.3.1/services/comm.cpp:1372:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(buf + 5 + sizeof(uint64_t), netname, length_netname - 1);
data/icecc-1.3.1/services/getifaddrs.cpp:196:38:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            storage[i].ia.ifa_name = strncpy(storage[i].name, ifr->ifr_name,
data/icecc-1.3.1/services/tempfile.c:70:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    tmpname_length = strlen(_PATH_TMP) + 1 + strlen(prefix) + 1 + 8 + strlen(suffix) + 1;
data/icecc-1.3.1/services/tempfile.c:70:46:  [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).
    tmpname_length = strlen(_PATH_TMP) + 1 + strlen(prefix) + 1 + 8 + strlen(suffix) + 1;
data/icecc-1.3.1/services/tempfile.c:70: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).
    tmpname_length = strlen(_PATH_TMP) + 1 + strlen(prefix) + 1 + 8 + strlen(suffix) + 1;
data/icecc-1.3.1/services/tempfile.c:149:29:  [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 tmpname_length = strlen(_PATH_TMP) + 1 + strlen(template) + 1;
data/icecc-1.3.1/services/tempfile.c:149: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).
    size_t tmpname_length = strlen(_PATH_TMP) + 1 + strlen(template) + 1;
data/icecc-1.3.1/services/util.cpp:97:77:  [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).
        return compiler.substr( 0, pos ) + "clang" + compiler.substr( pos + strlen( "clang++" ));
data/icecc-1.3.1/services/util.cpp:100:75:  [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).
        return compiler.substr( 0, pos ) + "gcc" + compiler.substr( pos + strlen( "g++" ));
data/icecc-1.3.1/services/util.cpp:103:74:  [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).
        return compiler.substr( 0, pos ) + "cc" + compiler.substr( pos + strlen( "c++" ));
data/icecc-1.3.1/services/util.cpp:118:75:  [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).
        return compiler.substr( 0, pos ) + "g++" + compiler.substr( pos + strlen( "gcc" ));
data/icecc-1.3.1/services/util.cpp:121:79:  [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).
        return compiler.substr( 0, pos ) + "clang++" + compiler.substr( pos + strlen( "clang" ));
data/icecc-1.3.1/services/util.cpp:124:75:  [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).
        return compiler.substr( 0, pos ) + "c++" + compiler.substr( pos + strlen( "cc" ));

ANALYSIS SUMMARY:

Hits = 260
Lines analyzed = 20154 in approximately 0.52 seconds (38423 lines/second)
Physical Source Lines of Code (SLOC) = 14490
Hits@level = [0]  38 [1]  49 [2] 107 [3]  53 [4]  34 [5]  17
Hits@level+ = [0+] 298 [1+] 260 [2+] 211 [3+] 104 [4+]  51 [5+]  17
Hits/KSLOC@level+ = [0+] 20.5659 [1+] 17.9434 [2+] 14.5618 [3+] 7.17736 [4+] 3.51967 [5+] 1.17322
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.