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/tiptop-2.3.1/src/priv.h Examining data/tiptop-2.3.1/src/target.c Examining data/tiptop-2.3.1/src/conf.c Examining data/tiptop-2.3.1/src/tiptop.c Examining data/tiptop-2.3.1/src/helpwin.h Examining data/tiptop-2.3.1/src/process.c Examining data/tiptop-2.3.1/src/debug.c Examining data/tiptop-2.3.1/src/pmc.h Examining data/tiptop-2.3.1/src/target.h Examining data/tiptop-2.3.1/src/helpwin.c Examining data/tiptop-2.3.1/src/conf.h Examining data/tiptop-2.3.1/src/process.h Examining data/tiptop-2.3.1/src/xml-parser.c Examining data/tiptop-2.3.1/src/options.h Examining data/tiptop-2.3.1/src/hash.c Examining data/tiptop-2.3.1/src/hash.h Examining data/tiptop-2.3.1/src/spawn.h Examining data/tiptop-2.3.1/src/error.h Examining data/tiptop-2.3.1/src/priv.c Examining data/tiptop-2.3.1/src/formula-parser.h Examining data/tiptop-2.3.1/src/screen.c Examining data/tiptop-2.3.1/src/options.c Examining data/tiptop-2.3.1/src/target-x86.c Examining data/tiptop-2.3.1/src/spawn.c Examining data/tiptop-2.3.1/src/xml-parser.h Examining data/tiptop-2.3.1/src/version.h Examining data/tiptop-2.3.1/src/requisite.h Examining data/tiptop-2.3.1/src/pmc.c Examining data/tiptop-2.3.1/src/error.c Examining data/tiptop-2.3.1/src/utils-expression.c Examining data/tiptop-2.3.1/src/version.c Examining data/tiptop-2.3.1/src/debug.h Examining data/tiptop-2.3.1/src/screen.h Examining data/tiptop-2.3.1/src/utils-expression.h Examining data/tiptop-2.3.1/src/requisite.c FINAL RESULTS: data/tiptop-2.3.1/src/conf.c:52: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(config_file, R_OK) == 0) { data/tiptop-2.3.1/src/conf.c:66:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(file, "%s/%s", path, config_file); data/tiptop-2.3.1/src/conf.c:68:7: [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, R_OK) == -1) { data/tiptop-2.3.1/src/conf.c:162:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(config, "0x%"PRIx64, c->config); data/tiptop-2.3.1/src/conf.c:263:7: [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_file, F_OK) != -1) data/tiptop-2.3.1/src/debug.c:46:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(debug_file, fmt, args); data/tiptop-2.3.1/src/error.c:81:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(error_file, fmt, args); data/tiptop-2.3.1/src/pmc.h:29:58: [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. #error Sorry, performance counters not supported on this system. data/tiptop-2.3.1/src/process.c:300:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(line, "%*s %s", proc_name); data/tiptop-2.3.1/src/process.c:718:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. sscanf(line, "%*s %s", proc_name); data/tiptop-2.3.1/src/screen.c:18:58: [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. #error Sorry, performance counters not supported on this system. data/tiptop-2.3.1/src/spawn.c:98:9: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (execvp(argv[0], argv) == -1) { data/tiptop-2.3.1/src/tiptop.c:230:19: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. written = snprintf(row, remaining, fmt, res); data/tiptop-2.3.1/src/conf.c:47:14: [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. path = getenv("TIPTOP"); data/tiptop-2.3.1/src/conf.c:59: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. path = getenv("HOME"); data/tiptop-2.3.1/src/conf.c:167: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(type, "0x%x", c->type); data/tiptop-2.3.1/src/conf.c:266:9: [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). out = fopen(config_file, "w"); data/tiptop-2.3.1/src/debug.c:37:18: [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). debug_file = fopen(debug_file_name, "w"); data/tiptop-2.3.1/src/error.c:49:18: [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). error_file = fopen(error_file_name, "w+"); data/tiptop-2.3.1/src/error.c:62:20: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). error_file = tmpfile(); data/tiptop-2.3.1/src/helpwin.c:44:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fmt[20] = { 0 }; data/tiptop-2.3.1/src/helpwin.c:45:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[100] = { 0 }; data/tiptop-2.3.1/src/options.c:271:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). options->max_iter = atoi(argv[i+1]); data/tiptop-2.3.1/src/options.c:288:24: [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). options->out = fopen(argv[i+1], "w"); data/tiptop-2.3.1/src/options.c:310:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). options->only_pid = atoi(argv[i+1]); data/tiptop-2.3.1/src/options.c:357:32: [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). options->watch_uid = atoi(argv[i+1]); data/tiptop-2.3.1/src/options.c:388: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). options->watch_pid = atoi(argv[i+1]); data/tiptop-2.3.1/src/options.c:408:27: [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). options->only_pid = atoi(argv[i]); data/tiptop-2.3.1/src/process.c:43:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[100] = { 0 }; /* needs to fit the name /proc/xxxx/limits */ data/tiptop-2.3.1/src/process.c:44:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[100]; data/tiptop-2.3.1/src/process.c:60:7: [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(name, "r"); data/tiptop-2.3.1/src/process.c:130:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[50] = { 0 }; /* needs to fit /proc/xxxx/cmdline */ data/tiptop-2.3.1/src/process.c:134:7: [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(name, "r"); data/tiptop-2.3.1/src/process.c:252:7: [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("/proc/loadavg", "r"); data/tiptop-2.3.1/src/process.c:278: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[50] = { 0 }; /* needs to fit /proc/xxxx/{status,cmdline} */ data/tiptop-2.3.1/src/process.c:279: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 line[100]; /* line of /proc/xxxx/status */ data/tiptop-2.3.1/src/process.c:280: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 proc_name[100]; data/tiptop-2.3.1/src/process.c:282: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 cmdline[100]; data/tiptop-2.3.1/src/process.c:287: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). if ((pid = atoi(pid_dirent->d_name)) == 0) /* not a number */ data/tiptop-2.3.1/src/process.c:291:9: [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(name, "r"); data/tiptop-2.3.1/src/process.c:348:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char task_name[50] = { 0 }; data/tiptop-2.3.1/src/process.c:360:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). tid = atoi(thr_dirent->d_name); data/tiptop-2.3.1/src/process.c:417:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen("/proc/uptime", "r"); data/tiptop-2.3.1/src/process.c:424:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(name, "r"); data/tiptop-2.3.1/src/process.c:497: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 sub_task_name[100] = { 0 }; data/tiptop-2.3.1/src/process.c:512:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fstat = fopen(sub_task_name, "r"); data/tiptop-2.3.1/src/process.c:704:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[50] = { 0 }; /* needs to fit /proc/xxxx/{status,cmdline} */ data/tiptop-2.3.1/src/process.c:705:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[100]; /* line of /proc/xxxx/status */ data/tiptop-2.3.1/src/process.c:706:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char proc_name[100]; data/tiptop-2.3.1/src/process.c:714:7: [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(name, "r"); data/tiptop-2.3.1/src/process.c:729: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[100]; data/tiptop-2.3.1/src/requisite.c:33:14: [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). paranoid = fopen(PARANOID1, "r"); data/tiptop-2.3.1/src/requisite.c:35:16: [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). paranoid = fopen(PARANOID2, "r"); data/tiptop-2.3.1/src/target-x86.c:87:3: [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(model, "%02X_%02X", disp_fam >> 8, disp_fam & 0xff); data/tiptop-2.3.1/src/target-x86.c:94:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cur_model[6]; data/tiptop-2.3.1/src/target-x86.c:96:3: [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(cur_model, "%02X_%02X", disp_fam >> 8, disp_fam & 0xff); data/tiptop-2.3.1/src/tiptop.c:305: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 outstr[200]; data/tiptop-2.3.1/src/tiptop.c:467: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 str[10] = { 0 }; data/tiptop-2.3.1/src/tiptop.c:476:18: [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). kill_pid = atoi(str); data/tiptop-2.3.1/src/tiptop.c:479:18: [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). kill_sig = atoi(str); data/tiptop-2.3.1/src/tiptop.c:484: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 tmp_message[100]; data/tiptop-2.3.1/src/tiptop.c:496: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 str[100] = { 0 }; /* initialize string to 0s */ data/tiptop-2.3.1/src/tiptop.c:501:24: [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). options.only_pid = atoi(str); data/tiptop-2.3.1/src/tiptop.c:523: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 str[100] = { 0 }; /* initialize string to 0s */ data/tiptop-2.3.1/src/tiptop.c:533:27: [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). options.watch_uid = atoi(str); data/tiptop-2.3.1/src/tiptop.c:545: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 str[100] = { 0 }; /* initialize string to 0s */ data/tiptop-2.3.1/src/tiptop.c:550: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). options.watch_pid = atoi(str); data/tiptop-2.3.1/src/tiptop.c:734:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char screen_str[50] = { 0 }; data/tiptop-2.3.1/src/xml-parser.c:51:47: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt->show_cmdline = (opt->show_cmdline || atoi((char*)val)); data/tiptop-2.3.1/src/xml-parser.c:54:43: [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). opt->show_epoch = (opt->show_epoch || atoi((char*)val)); data/tiptop-2.3.1/src/xml-parser.c:57:45: [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). opt->show_kernel = (opt->show_kernel || atoi((char*)val)); data/tiptop-2.3.1/src/xml-parser.c:60:22: [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). opt->show_user = atoi((char*)val); data/tiptop-2.3.1/src/xml-parser.c:63: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). opt->debug = (opt->debug || atoi((char*)val)); data/tiptop-2.3.1/src/xml-parser.c:66:41: [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). opt->watch_uid = (opt->watch_uid || atoi((char*)val)); data/tiptop-2.3.1/src/xml-parser.c:72:21: [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). opt->max_iter = atoi((char*)val); data/tiptop-2.3.1/src/xml-parser.c:75:51: [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). opt->show_timestamp = (opt->show_timestamp || atoi((char*)val)); data/tiptop-2.3.1/src/xml-parser.c:78: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). opt->show_threads = atoi((char*)val); data/tiptop-2.3.1/src/xml-parser.c:81:17: [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). opt->idle = atoi((const char*)val); data/tiptop-2.3.1/src/xml-parser.c:84:19: [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). opt->sticky = atoi((const char*)val); data/tiptop-2.3.1/src/conf.c:65:17: [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). file = malloc(strlen(path) + strlen(config_file) + 2); data/tiptop-2.3.1/src/conf.c:65:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). file = malloc(strlen(path) + strlen(config_file) + 2); data/tiptop-2.3.1/src/error.c:185:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (buf[strlen(buf)-1] != '\n') data/tiptop-2.3.1/src/error.c:196:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (buf[strlen(buf)-1] == '\n') /* To keep box's border */ data/tiptop-2.3.1/src/error.c:197:11: [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). buf[strlen(buf)-1] = 0; data/tiptop-2.3.1/src/helpwin.c:72:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(ptr) > header_width) data/tiptop-2.3.1/src/helpwin.c:73: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). header_width = strlen(ptr); data/tiptop-2.3.1/src/process.c:151: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(result, "[null]", size-1); data/tiptop-2.3.1/src/process.c:581:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read(proc->fd[zz], &value, sizeof(value)); data/tiptop-2.3.1/src/screen.c:173: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). if (desc == NULL || strlen(desc) == 0) data/tiptop-2.3.1/src/screen.c:472:15: [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). col_width = strlen(header); data/tiptop-2.3.1/src/spawn.c:94:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(pipefd[0], &buffer, 1); /* blocking read */ data/tiptop-2.3.1/src/tiptop.c:260:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(row, p->cmdline, remaining); data/tiptop-2.3.1/src/tiptop.c:262:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(row, p->name, remaining); data/tiptop-2.3.1/src/tiptop.c:666:12: [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). for(zz=strlen(header); zz < COLS-1; zz++) data/tiptop-2.3.1/src/tiptop.c:729: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). if (35 + 20 + 11 + strlen(screen->name) < COLS) { data/tiptop-2.3.1/src/tiptop.c:730:31: [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). mvprintw(1, COLS - 11 - strlen(screen->name), data/tiptop-2.3.1/src/utils-expression.c:39:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, ptr_myinput, buffer_size); data/tiptop-2.3.1/src/utils-expression.c:40:9: [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 = strlen(buffer); data/tiptop-2.3.1/src/utils-expression.c:190:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(txt) > 0) { data/tiptop-2.3.1/src/xml-parser.c:98: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). if (name == NULL || strlen(name) == 0) data/tiptop-2.3.1/src/xml-parser.c:124:17: [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(!header || strlen(header) == 0){ data/tiptop-2.3.1/src/xml-parser.c:130:17: [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(!format || strlen(header) == 0){ ANALYSIS SUMMARY: Hits = 102 Lines analyzed = 5702 in approximately 0.15 seconds (38635 lines/second) Physical Source Lines of Code (SLOC) = 3995 Hits@level = [0] 154 [1] 23 [2] 64 [3] 2 [4] 13 [5] 0 Hits@level+ = [0+] 256 [1+] 102 [2+] 79 [3+] 15 [4+] 13 [5+] 0 Hits/KSLOC@level+ = [0+] 64.0801 [1+] 25.5319 [2+] 19.7747 [3+] 3.75469 [4+] 3.25407 [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.