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/hxtools-20200712/sadmin/clock_info.c Examining data/hxtools-20200712/sadmin/ofl.c Examining data/hxtools-20200712/sadmin/proc_iomem_count.c Examining data/hxtools-20200712/sadmin/proc_stat_parse.c Examining data/hxtools-20200712/sadmin/psthreads.c Examining data/hxtools-20200712/sadmin/utmp_register.c Examining data/hxtools-20200712/sadmin/xfs_irecover.c Examining data/hxtools-20200712/sadmin/fd0ssh.c Examining data/hxtools-20200712/sdevel/bin2c.c Examining data/hxtools-20200712/sdevel/cctypeinfo.c Examining data/hxtools-20200712/sdevel/gxxdm.cpp Examining data/hxtools-20200712/sdevel/kcctypeinfo/kcctypeinfo.c Examining data/hxtools-20200712/sdevel/peicon.c Examining data/hxtools-20200712/smath/graph-fanout.c Examining data/hxtools-20200712/smath/graph-lchain.c Examining data/hxtools-20200712/smm/bsvplay.c Examining data/hxtools-20200712/smm/hcdplay.c Examining data/hxtools-20200712/smm/pcmdiff.c Examining data/hxtools-20200712/smm/pcmmix.c Examining data/hxtools-20200712/smm/pcspkr.h Examining data/hxtools-20200712/smm/pcspkr_pcm.c Examining data/hxtools-20200712/smm/vfalib.cpp Examining data/hxtools-20200712/smm/vfalib.hpp Examining data/hxtools-20200712/smm/vfontas.cpp Examining data/hxtools-20200712/smm/qplay.c Examining data/hxtools-20200712/suser/declone.c Examining data/hxtools-20200712/suser/sysinfo.c Examining data/hxtools-20200712/suser/tailhex.c Examining data/hxtools-20200712/suser/xcp.c FINAL RESULTS: data/hxtools-20200712/sadmin/ofl.c:46:8: [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. ret = readlink(src, dst, sizeof(dst) - 1); data/hxtools-20200712/sadmin/ofl.c:158:12: [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. lnk_len = readlink(entry, tmp, sizeof(tmp) - 1); data/hxtools-20200712/sadmin/fd0ssh.c:69:9: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return execvp(*argv, (char *const *)argv); data/hxtools-20200712/sadmin/proc_stat_parse.c:48:2: [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. If the scanf format is influenceable by an attacker, it's exploitable. sscanf(s,/*1 */ "%d %31s %c %d %d " data/hxtools-20200712/sdevel/bin2c.c:267:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(state->cfp, /* { */ "}\n"); data/hxtools-20200712/sdevel/bin2c.c:281:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(state->cfp, "void bin2c_init_%s(void)\n{\n" /* } */, data/hxtools-20200712/sadmin/fd0ssh.c:177:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. s = getenv("SSH_ASKPASS_FD"); data/hxtools-20200712/sadmin/clock_info.c:115:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/hxtools-20200712/sadmin/fd0ssh.c:32:7: [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("/dev/tty", O_RDWR); data/hxtools-20200712/sadmin/fd0ssh.c:74:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char password[256], *p; data/hxtools-20200712/sadmin/fd0ssh.c:93:7: [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("/dev/null", O_RDONLY); data/hxtools-20200712/sadmin/ofl.c:41:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char src[64], dst[512]; data/hxtools-20200712/sadmin/ofl.c:89:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[24]; data/hxtools-20200712/sadmin/ofl.c:117:12: [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). if ((fp = fopen(map_file, "r")) == NULL) data/hxtools-20200712/sadmin/ofl.c:152:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[512]; data/hxtools-20200712/sadmin/ofl.c:173:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[256]; data/hxtools-20200712/sadmin/ofl.c:201:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[256]; data/hxtools-20200712/sadmin/ofl.c:227:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[256]; data/hxtools-20200712/sadmin/proc_iomem_count.c:29: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). fp = fopen(file, "r"); data/hxtools-20200712/sadmin/proc_stat_parse.c:18:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char comm[32], state; data/hxtools-20200712/sadmin/proc_stat_parse.c:150: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). FILE *fp = fopen(*argv, "r"); data/hxtools-20200712/sadmin/psthreads.c:56:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[200]; data/hxtools-20200712/sadmin/psthreads.c:104:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *ptr, *field[__STAT_NFIELDS+1]; data/hxtools-20200712/sadmin/psthreads.c:133:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64]; data/hxtools-20200712/sadmin/psthreads.c:145:12: [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(buf, O_RDONLY)) >= 0) data/hxtools-20200712/sadmin/psthreads.c:149:12: [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). if ((fp = fopen(buf, "r")) != NULL) data/hxtools-20200712/sadmin/psthreads.c:153:12: [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). if ((fp = fopen(buf, "r")) != NULL) data/hxtools-20200712/sadmin/psthreads.c:162:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64]; data/hxtools-20200712/sadmin/utmp_register.c:119:12: [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(_PATH_LASTLOG, O_WRONLY)) < 0) data/hxtools-20200712/sadmin/utmp_register.c:154:3: [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(&entry.ut_id[2], &p, 2); data/hxtools-20200712/sadmin/xfs_irecover.c:217:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[64], *ret, *wp, **lines, **exts; data/hxtools-20200712/sadmin/xfs_irecover.c:286:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/hxtools-20200712/sadmin/xfs_irecover.c:291:12: [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(buf, O_WRONLY | O_CREAT | O_TRUNC, data/hxtools-20200712/sadmin/xfs_irecover.c:508:21: [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). work_info->blkfd = open(work_info->device, O_RDONLY); data/hxtools-20200712/sdevel/bin2c.c:169:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char input_buf[4096], *output_buf; data/hxtools-20200712/sdevel/bin2c.c:215:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char input_buf[4096], *output_buf; data/hxtools-20200712/sdevel/bin2c.c:287:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char input_buf[4096], *output_buf; data/hxtools-20200712/sdevel/bin2c.c:373: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). state->ifp = fopen(state->ifile_path, "r"); data/hxtools-20200712/sdevel/bin2c.c:418: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). state.hfp = fopen(btc_hfile, "w"); data/hxtools-20200712/sdevel/bin2c.c:426: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). state.cfp = fopen(btc_cfile, "w"); data/hxtools-20200712/sdevel/peicon.c:47:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[8]; data/hxtools-20200712/sdevel/peicon.c:96:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fs_name[64], fs_type; data/hxtools-20200712/sdevel/peicon.c:348:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[64]; data/hxtools-20200712/sdevel/peicon.c:372:8: [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(filename, O_WRONLY | O_CREAT | O_TRUNC, data/hxtools-20200712/sdevel/peicon.c:594:7: [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(argv[1], O_RDONLY); data/hxtools-20200712/smath/graph-fanout.c:159:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/hxtools-20200712/smath/graph-fanout.c:295: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). fp = fopen(*file, "r"); data/hxtools-20200712/smath/graph-lchain.c:268: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). fp = fopen(*file, "r"); data/hxtools-20200712/smm/bsvplay.c:172:8: [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(file, O_RDONLY); data/hxtools-20200712/smm/hcdplay.c:65:7: [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(cdev, O_RDONLY); data/hxtools-20200712/smm/pcmdiff.c:71:20: [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 ((file[0].fd = open(argv[1], O_RDONLY)) < 0) { data/hxtools-20200712/smm/pcmdiff.c:75:20: [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 ((file[1].fd = open(argv[2], O_RDONLY)) < 0) { data/hxtools-20200712/smm/pcmdiff.c:81:27: [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). } else if ((file[2].fd = open(argv[3], O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { data/hxtools-20200712/smm/pcmmix.c:87:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). inputfd[i] = open(argv[i], O_RDONLY); data/hxtools-20200712/smm/qplay.c:47:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char lookup[4] = {}; data/hxtools-20200712/smm/qplay.c:223:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char var_name[64] = {}; data/hxtools-20200712/smm/qplay.c:338:8: [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(fn, "r"); data/hxtools-20200712/smm/vfalib.cpp:99: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). static FILE *fopen(const char *name, const char *mode) data/hxtools-20200712/smm/vfalib.cpp:102:12: [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). return ::fopen(name, mode); data/hxtools-20200712/smm/vfalib.cpp:135:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(file, "rb")); data/hxtools-20200712/smm/vfalib.cpp:220:39: [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). std::unique_ptr<FILE, deleter> fp(::fopen(fn.c_str(), "r")); data/hxtools-20200712/smm/vfalib.cpp:270:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(file, "rb")); data/hxtools-20200712/smm/vfalib.cpp:298:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(file, "r")); data/hxtools-20200712/smm/vfalib.cpp:315: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 gbits[32]{}; data/hxtools-20200712/smm/vfalib.cpp:398:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(file, "rb")); data/hxtools-20200712/smm/vfalib.cpp:460:39: [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). std::unique_ptr<FILE, deleter> filep(fopen(file, "w")); data/hxtools-20200712/smm/vfalib.cpp:563:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(outpath.c_str(), "w")); data/hxtools-20200712/smm/vfalib.cpp:579:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(file, "wb")); data/hxtools-20200712/smm/vfalib.cpp:592:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(file, "w")); data/hxtools-20200712/smm/vfalib.cpp:630:38: [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). std::unique_ptr<FILE, deleter> fp(::fopen(outpath.c_str(), "w")); data/hxtools-20200712/smm/vfalib.cpp:646:36: [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). std::unique_ptr<FILE, deleter> fp(fopen(file, "wb")); data/hxtools-20200712/smm/vfalib.cpp:675:4: [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 ob[8]; data/hxtools-20200712/smm/vfalib.cpp:715:39: [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). std::unique_ptr<FILE, deleter> filep(fopen(file, "w")); data/hxtools-20200712/smm/vfontas.cpp:34:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char id[7], reserved[8]; data/hxtools-20200712/smm/vfontas.cpp:48:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char device_name[8]; data/hxtools-20200712/smm/vfontas.cpp:50:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char reserved[6]; data/hxtools-20200712/smm/vfontas.cpp:153: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). auto ret = f.load_fnt(args[0], atoi(args[1])); data/hxtools-20200712/smm/vfontas.cpp:305:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[HXSIZEOF_Z32*3]; data/hxtools-20200712/smm/vfontas.cpp:310: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). auto out_fd = open(out_file.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUGO | S_IWUGO); data/hxtools-20200712/smm/vfontas.cpp:364:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[HXSIZEOF_Z32*2]; data/hxtools-20200712/smm/vfontas.cpp:378:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). auto in_fd = open(args[0], O_RDONLY); data/hxtools-20200712/suser/declone.c:23:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[BLOCKSIZE]; data/hxtools-20200712/suser/declone.c:26:12: [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 ((in = open(file, O_RDONLY)) < 0) { data/hxtools-20200712/suser/declone.c:41: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). if ((out = open(file, O_WRONLY | O_TRUNC | O_CREAT, data/hxtools-20200712/suser/sysinfo.c:46:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char gfx_hardware_buf[128]; data/hxtools-20200712/suser/sysinfo.c:62:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[80]; data/hxtools-20200712/suser/sysinfo.c:130: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). FILE *fp = fopen(sy_cpuinfo_file, "r"); data/hxtools-20200712/suser/sysinfo.c:165:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[80]; data/hxtools-20200712/suser/sysinfo.c:175:8: [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(path, "r"); data/hxtools-20200712/suser/sysinfo.c:193: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). FILE *fp = fopen("/proc/loadavg", "r"); data/hxtools-20200712/suser/sysinfo.c:205: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). FILE *fp = fopen("/proc/meminfo", "r"); data/hxtools-20200712/suser/tailhex.c:91:12: [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(*++argv, O_RDONLY)) < 0) { data/hxtools-20200712/suser/xcp.c:55:8: [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(input, O_RDONLY); data/hxtools-20200712/suser/xcp.c:61:8: [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(output, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); data/hxtools-20200712/suser/xcp.c:106:8: [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(input, O_RDONLY); data/hxtools-20200712/suser/xcp.c:112:8: [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(output, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); data/hxtools-20200712/sadmin/fd0ssh.c:45: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). unsigned int pw_len = strlen(password); data/hxtools-20200712/sadmin/fd0ssh.c:84: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). p = password + strlen(password); data/hxtools-20200712/sadmin/fd0ssh.c:147:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(in_fd, buf, 4096); data/hxtools-20200712/sadmin/ofl.c:53:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, p, size); data/hxtools-20200712/sadmin/ofl.c:76: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). mnt_len = strlen(mnt); data/hxtools-20200712/sadmin/psthreads.c:58:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, buf, sizeof(buf)); data/hxtools-20200712/sadmin/utmp_register.c:128:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry.ll_line, utmp->ut_line, data/hxtools-20200712/sadmin/utmp_register.c:130:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry.ll_host, utmp->ut_host, data/hxtools-20200712/sadmin/utmp_register.c:148:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry.ut_line, Opt.line, sizeof(entry.ut_line)); data/hxtools-20200712/sadmin/utmp_register.c:156: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). size_t sz = strlen(Opt.line); data/hxtools-20200712/sadmin/utmp_register.c:160:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry.ut_id, str, sizeof(entry.ut_id)); data/hxtools-20200712/sadmin/xfs_irecover.c:126:28: [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). write(wi->xdb_write, cmd, strlen(cmd)); data/hxtools-20200712/sadmin/xfs_irecover.c:132:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(wi->xdb_read, wi->buffer + have_read, amount); data/hxtools-20200712/sadmin/xfs_irecover.c:162:2: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(wi->blkfd, i, sizeof(*i)); data/hxtools-20200712/sadmin/xfs_irecover.c:227: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). if (strncmp(lines[i], "u.bmx[", strlen("u.bmx[")) == 0) /* ]] */ data/hxtools-20200712/sadmin/xfs_irecover.c:265:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(ifd, wi->buffer, segment); data/hxtools-20200712/sadmin/xfs_irecover.c:400:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(work_info->xdb_read, work_info->buffer, data/hxtools-20200712/sadmin/xfs_irecover.c:401:6: [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). strlen("xfs_db> ")); data/hxtools-20200712/sadmin/xfs_irecover.c:402: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). if (i != strlen("xfs_db> ")) { data/hxtools-20200712/sdevel/bin2c.c:145:27: [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 btc_memquote(src, strlen(src)); data/hxtools-20200712/sdevel/bin2c.c:190: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). fwrite(output_buf, strlen(output_buf), 1, state->cfp); data/hxtools-20200712/sdevel/bin2c.c:237: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). fwrite(output_buf, strlen(output_buf), 1, state->cfp); data/hxtools-20200712/sdevel/bin2c.c:297: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). fwrite(output_buf, strlen(output_buf), 1, state->cfp); data/hxtools-20200712/sdevel/bin2c.c:331:16: [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). eof = cfile + strlen(cfile) - 1; data/hxtools-20200712/smm/bsvplay.c:80:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read(fd, &tone, sizeof(struct bsv_insn)) == data/hxtools-20200712/smm/bsvplay.c:129:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read(fd, &tone, sizeof(tone)) == sizeof(tone)) { data/hxtools-20200712/smm/pcmmix.c:32:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t ret = read(fd, (char *)buf + pos, rem); data/hxtools-20200712/smm/qplay.c:249:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(var_name, var_begin, (var_size + 1 > sizeof(var_name)) ? data/hxtools-20200712/smm/vfalib.cpp:349:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto ret = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:363:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:374:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto x = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:377:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto y = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:386:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). uint8_t x = fgetc(fp), y = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:386:29: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). uint8_t x = fgetc(fp), y = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:391:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). x = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:392:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). y = fgetc(fp); data/hxtools-20200712/smm/vfalib.cpp:407:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto mode = fgetc(fp.get()), charsize = fgetc(fp.get()); data/hxtools-20200712/smm/vfalib.cpp:407:43: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto mode = fgetc(fp.get()), charsize = fgetc(fp.get()); data/hxtools-20200712/suser/declone.c:52:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ret = read(in, buffer, BLOCKSIZE)) > 0) data/hxtools-20200712/suser/tailhex.c:111:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, buf + buf_offset, Opt.bsize - buf_offset); ANALYSIS SUMMARY: Hits = 136 Lines analyzed = 8749 in approximately 0.35 seconds (24922 lines/second) Physical Source Lines of Code (SLOC) = 7177 Hits@level = [0] 460 [1] 40 [2] 89 [3] 1 [4] 4 [5] 2 Hits@level+ = [0+] 596 [1+] 136 [2+] 96 [3+] 7 [4+] 6 [5+] 2 Hits/KSLOC@level+ = [0+] 83.0431 [1+] 18.9494 [2+] 13.3761 [3+] 0.975338 [4+] 0.836004 [5+] 0.278668 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.