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/niceshaper-1.2.4/include/linux/pkt_sched.h Examining data/niceshaper-1.2.4/include/linux/types.h Examining data/niceshaper-1.2.4/src/logger.cc Examining data/niceshaper-1.2.4/src/tests.h Examining data/niceshaper-1.2.4/src/filter.h Examining data/niceshaper-1.2.4/src/config.cc Examining data/niceshaper-1.2.4/src/config.h Examining data/niceshaper-1.2.4/src/aux.h Examining data/niceshaper-1.2.4/src/ifaces.h Examining data/niceshaper-1.2.4/src/filter.cc Examining data/niceshaper-1.2.4/src/ifaces.cc Examining data/niceshaper-1.2.4/src/supervisor.cc Examining data/niceshaper-1.2.4/src/trigger.h Examining data/niceshaper-1.2.4/src/worker.cc Examining data/niceshaper-1.2.4/src/class.h Examining data/niceshaper-1.2.4/src/sys.h Examining data/niceshaper-1.2.4/src/main.h Examining data/niceshaper-1.2.4/src/class.cc Examining data/niceshaper-1.2.4/src/worker.h Examining data/niceshaper-1.2.4/src/talk.cc Examining data/niceshaper-1.2.4/src/logger.h Examining data/niceshaper-1.2.4/src/libnetlink.cc Examining data/niceshaper-1.2.4/src/iptables.h Examining data/niceshaper-1.2.4/src/main.cc Examining data/niceshaper-1.2.4/src/iptables.cc Examining data/niceshaper-1.2.4/src/libnetlink.h Examining data/niceshaper-1.2.4/src/supervisor.h Examining data/niceshaper-1.2.4/src/sys.cc Examining data/niceshaper-1.2.4/src/niceshaper.h Examining data/niceshaper-1.2.4/src/aux.cc Examining data/niceshaper-1.2.4/src/talk.h Examining data/niceshaper-1.2.4/src/trigger.cc Examining data/niceshaper-1.2.4/src/tests.cc Examining data/niceshaper-1.2.4/src/niceshaper.cc FINAL RESULTS: data/niceshaper-1.2.4/src/class.cc:458:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system(TcQdiscEsfqAdd.c_str()) == -1) return -1; data/niceshaper-1.2.4/src/ifaces.cc:276:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system(std::string("ip link set " + dev->Name + " up").c_str()) == -1) { return -1; } data/niceshaper-1.2.4/src/ifaces.cc:286:13: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system(std::string("tc qdisc del dev " + dev->Name + " root 2> /dev/null > /dev/null").c_str()) == -1) { sys->rtnlClose(); return -1; } data/niceshaper-1.2.4/src/iptables.cc:130:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system(command.c_str()) == -1) return -1; data/niceshaper-1.2.4/src/iptables.cc:203:18: [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. fp = popen("iptables-save -t mangle", "r"); data/niceshaper-1.2.4/src/iptables.cc:629:14: [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. fp = popen(("iptables -t mangle -L " + chain + " -vnx").c_str(), "r"); data/niceshaper-1.2.4/src/logger.cc:516:5: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. syslog (LOG_NOTICE, message.c_str(), getuid ()); data/niceshaper-1.2.4/src/main.cc:142: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(pidfile.c_str(), 0) == 0) { log->error(44); return -1; } // NiceShaper already running data/niceshaper-1.2.4/src/main.cc:283:45: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (runtime_param_status_watch) system ("clear"); data/niceshaper-1.2.4/src/main.cc:317:17: [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. while (!access (pidfile.c_str(), 0)) data/niceshaper-1.2.4/src/supervisor.cc:211: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 (config->getStatusFilePath().c_str(), W_OK)) creat (config->getStatusFilePath().c_str(), O_WRONLY); data/niceshaper-1.2.4/src/supervisor.cc:214:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system (buf.c_str()); data/niceshaper-1.2.4/src/tests.cc:69:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path.c_str(), F_OK)) { data/niceshaper-1.2.4/src/tests.cc:78:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path.c_str(), R_OK)) { data/niceshaper-1.2.4/src/tests.cc:87:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access( path.c_str(), W_OK)) { data/niceshaper-1.2.4/src/tests.cc:96:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(path.c_str(), X_OK)) { data/niceshaper-1.2.4/src/main.cc:78:22: [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. char *env_lang = getenv("LANG"); data/niceshaper-1.2.4/src/main.cc:82: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(NULL)); data/niceshaper-1.2.4/src/sys.cc:586: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("HZ")) data/niceshaper-1.2.4/src/sys.cc:587: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. return atoi(getenv("HZ")) ? atoi(getenv("HZ")) : HZ; data/niceshaper-1.2.4/src/sys.cc:587: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. return atoi(getenv("HZ")) ? atoi(getenv("HZ")) : HZ; data/niceshaper-1.2.4/src/sys.cc:589: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("PROC_NET_PSCHED")) { data/niceshaper-1.2.4/src/sys.cc:590:46: [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. snprintf(name, sizeof(name)-1, "%s", getenv("PROC_NET_PSCHED")); data/niceshaper-1.2.4/src/sys.cc:591:16: [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 (getenv("PROC_ROOT")) { data/niceshaper-1.2.4/src/sys.cc:592:57: [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. snprintf(name, sizeof(name)-1, "%s/net/psched", getenv("PROC_ROOT")); data/niceshaper-1.2.4/src/tests.cc:113:22: [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. char *env_lang = getenv("PATH"); data/niceshaper-1.2.4/src/config.cc:89: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 sbuf[MAX_LONG_BUF_SIZE]; data/niceshaper-1.2.4/src/config.cc:173:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ifd.open(src_file.c_str()); data/niceshaper-1.2.4/src/config.cc:598:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char t1_src[10][MAX_SHORT_BUF_SIZE] = { "ceil", "hold", "lang", "low", "mode", "rate", "reload", "set-mark", "strict" }; data/niceshaper-1.2.4/src/config.cc:603:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char t2_src[5][MAX_SHORT_BUF_SIZE] = { "debug", "mark-on-ifaces", "local-subnets", "run", "fallback" }; data/niceshaper-1.2.4/src/config.cc:609:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char t4_src[14][17][MAX_SHORT_BUF_SIZE] = {{ "log", "file", "syslog", "terminal" }, data/niceshaper-1.2.4/src/config.cc:623:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char t4iface_src[5][MAX_SHORT_BUF_SIZE] = { "speed", "do-not-shape-method", "unclassified-method", "fallback-rate", "mode" }; data/niceshaper-1.2.4/src/config.cc:632:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char t5_src[6][MAX_SHORT_BUF_SIZE] = { "class", "class-virtual", "class-wrapper", "class-do-not-shape", "match", "include" }; data/niceshaper-1.2.4/src/config.cc:637:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char t6host_src[1][MAX_SHORT_BUF_SIZE] = { "host" }; data/niceshaper-1.2.4/src/ifaces.cc:116: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(ifr2.ifr_name, "imq%d", n); data/niceshaper-1.2.4/src/iptables.cc:175: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 cbuf[MAX_LONG_BUF_SIZE]; data/niceshaper-1.2.4/src/iptables.cc:201: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). ofd.open(iptfile.c_str()); data/niceshaper-1.2.4/src/iptables.cc:597: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 cbuf[MAX_LONG_BUF_SIZE]; data/niceshaper-1.2.4/src/libnetlink.cc:144: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[8192]; data/niceshaper-1.2.4/src/libnetlink.cc:238: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[8192]; data/niceshaper-1.2.4/src/libnetlink.cc:314:57: [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(answer, h, h->nlmsg_len); data/niceshaper-1.2.4/src/libnetlink.cc:322:33: [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(answer, h, h->nlmsg_len); data/niceshaper-1.2.4/src/libnetlink.cc:351: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[8192]; data/niceshaper-1.2.4/src/libnetlink.cc:554: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[8]; data/niceshaper-1.2.4/src/libnetlink.cc:575: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[4096]; data/niceshaper-1.2.4/src/libnetlink.cc:670: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(RTA_DATA(rta), &data, 4); data/niceshaper-1.2.4/src/libnetlink.cc:686: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(RTA_DATA(rta), data, alen); data/niceshaper-1.2.4/src/libnetlink.cc:702: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(RTA_DATA(subrta), &data, 4); data/niceshaper-1.2.4/src/libnetlink.cc:718: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(RTA_DATA(subrta), data, alen); data/niceshaper-1.2.4/src/logger.cc:524:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(LogFile.c_str(), O_CREAT | O_WRONLY | O_APPEND, S_IRUSR|S_IWUSR); data/niceshaper-1.2.4/src/main.cc:235: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). ifd.open(svinfofile.c_str()); data/niceshaper-1.2.4/src/main.cc:306: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). ifd.open(pidfile.c_str()); data/niceshaper-1.2.4/src/supervisor.cc:171:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofd.open(pidfile.c_str()); data/niceshaper-1.2.4/src/supervisor.cc:177:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ofd.open(svinfofile.c_str()); data/niceshaper-1.2.4/src/supervisor.cc:687:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(config->getStatusFilePath().c_str(), O_RDWR | O_TRUNC); data/niceshaper-1.2.4/src/sys.cc:106: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[4096]; data/niceshaper-1.2.4/src/sys.cc:108: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 k[16]; data/niceshaper-1.2.4/src/sys.cc:197: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 k[16]; data/niceshaper-1.2.4/src/sys.cc:202: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[(64*1024)]; data/niceshaper-1.2.4/src/sys.cc:272: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[16384]; data/niceshaper-1.2.4/src/sys.cc:276: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 k[16]; data/niceshaper-1.2.4/src/sys.cc:358: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 d[16]; data/niceshaper-1.2.4/src/sys.cc:512:10: [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). fp = fopen("/proc/net/psched", "r"); data/niceshaper-1.2.4/src/sys.cc:582: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 name[1024]; data/niceshaper-1.2.4/src/sys.cc:587:16: [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). return atoi(getenv("HZ")) ? atoi(getenv("HZ")) : HZ; data/niceshaper-1.2.4/src/sys.cc:587: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). return atoi(getenv("HZ")) ? atoi(getenv("HZ")) : HZ; data/niceshaper-1.2.4/src/sys.cc:594:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(name, "/proc/net/psched"); data/niceshaper-1.2.4/src/sys.cc:596:10: [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). fp = fopen(name, "r"); data/niceshaper-1.2.4/src/talk.cc:86: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[MAX_MESSAGE_SIZE]; data/niceshaper-1.2.4/src/worker.cc:317: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). ofd.open(QuotaFile.c_str()); data/niceshaper-1.2.4/src/worker.cc:340:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ifd.open (QuotaFile.c_str()); data/niceshaper-1.2.4/src/config.cc:94:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (src_file.read(&cbuf, 1)) data/niceshaper-1.2.4/src/ifaces.cc:100:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr2.ifr_name, ifr[i].ifr_name, sizeof(ifr2.ifr_name)); data/niceshaper-1.2.4/src/main.cc:83:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (umask(000) | 007); data/niceshaper-1.2.4/src/main.cc:83:12: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (umask(000) | 007); data/niceshaper-1.2.4/src/main.cc:166:9: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); data/niceshaper-1.2.4/src/main.cc:288:49: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. } while (runtime_param_status_watch && (usleep(runtime_param_status_watch*1000000) != -1)); data/niceshaper-1.2.4/src/main.cc:333:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (100000); data/niceshaper-1.2.4/src/main.cc:646:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); data/niceshaper-1.2.4/src/supervisor.cc:74:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (100000); data/niceshaper-1.2.4/src/supervisor.cc:85:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (100000); data/niceshaper-1.2.4/src/supervisor.cc:277:17: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. if (usleep(static_cast<unsigned int>(tv_sleep_duration.tv_usec)) != 0) data/niceshaper-1.2.4/src/supervisor.cc:551:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (5000000); data/niceshaper-1.2.4/src/supervisor.cc:560:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (5000000); data/niceshaper-1.2.4/src/supervisor.cc:567:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (5000000); data/niceshaper-1.2.4/src/supervisor.cc:599:17: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep (1000000); data/niceshaper-1.2.4/src/supervisor.cc:672:13: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); data/niceshaper-1.2.4/src/sys.cc:147:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(k, "htb", sizeof(k)-1); data/niceshaper-1.2.4/src/sys.cc:150:64: [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). RTNetlink::addattr_l(&req.n, sizeof(req), TCA_KIND, k, strlen(k)+1); data/niceshaper-1.2.4/src/sys.cc:240:31: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. if (tc_qdisc_kind == SFQ) strncpy(k, "sfq", sizeof(k)-1); data/niceshaper-1.2.4/src/sys.cc:241:36: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. else if (tc_qdisc_kind == HTB) strncpy(k, "htb", sizeof(k)-1); data/niceshaper-1.2.4/src/sys.cc:245:64: [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). RTNetlink::addattr_l(&req.n, sizeof(req), TCA_KIND, k, strlen(k)+1); data/niceshaper-1.2.4/src/sys.cc:303:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(k, "u32", sizeof(k)-1); data/niceshaper-1.2.4/src/sys.cc:307:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(k, "fw", sizeof(k)-1); data/niceshaper-1.2.4/src/sys.cc:314:60: [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). RTNetlink::addattr_l(&req.n, sizeof(req), TCA_KIND, k, strlen(k)+1); data/niceshaper-1.2.4/src/talk.cc:48:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(pipe, &cbuf, 1) != 1) { data/niceshaper-1.2.4/src/talk.cc:96:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(pipe, &cbuf, 1) != 1) { log->error(310, "int Talk::recvText"); return -1; } data/niceshaper-1.2.4/src/talk.cc:106:9: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(buf, ""); data/niceshaper-1.2.4/src/talk.cc:110:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((msg_len_got=read(pipe, buf+msg_len_got, msg_len)) <= 0 ) { log->error(310, "int Talk::recvText"); return -1; } ANALYSIS SUMMARY: Hits = 99 Lines analyzed = 10297 in approximately 0.28 seconds (37349 lines/second) Physical Source Lines of Code (SLOC) = 8174 Hits@level = [0] 10 [1] 28 [2] 45 [3] 10 [4] 16 [5] 0 Hits@level+ = [0+] 109 [1+] 99 [2+] 71 [3+] 26 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 13.335 [1+] 12.1116 [2+] 8.68608 [3+] 3.18082 [4+] 1.95743 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.