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/uftrace-0.9.4/arch/aarch64/cpuinfo.c Examining data/uftrace-0.9.4/arch/aarch64/mcount-arch.h Examining data/uftrace-0.9.4/arch/aarch64/mcount-dynamic.c Examining data/uftrace-0.9.4/arch/aarch64/mcount-insn.c Examining data/uftrace-0.9.4/arch/aarch64/mcount-support.c Examining data/uftrace-0.9.4/arch/arm/cpuinfo.c Examining data/uftrace-0.9.4/arch/arm/mcount-arch.h Examining data/uftrace-0.9.4/arch/arm/mcount-support.c Examining data/uftrace-0.9.4/arch/i386/cpuinfo.c Examining data/uftrace-0.9.4/arch/i386/mcount-arch.h Examining data/uftrace-0.9.4/arch/i386/mcount-dynamic.c Examining data/uftrace-0.9.4/arch/i386/mcount-support.c Examining data/uftrace-0.9.4/arch/x86_64/cpuinfo.c Examining data/uftrace-0.9.4/arch/x86_64/mcount-arch.h Examining data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c Examining data/uftrace-0.9.4/arch/x86_64/mcount-event.c Examining data/uftrace-0.9.4/arch/x86_64/mcount-insn.c Examining data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c Examining data/uftrace-0.9.4/arch/x86_64/mcount-support.c Examining data/uftrace-0.9.4/arch/x86_64/symbol.c Examining data/uftrace-0.9.4/check-deps/__arm_has_hardfp.c Examining data/uftrace-0.9.4/check-deps/__cc_has_mfentry.c Examining data/uftrace-0.9.4/check-deps/__cc_has_mno_sse2.c Examining data/uftrace-0.9.4/check-deps/__clock_without_librt.c Examining data/uftrace-0.9.4/check-deps/__cxa_demangle.c Examining data/uftrace-0.9.4/check-deps/__have_libcapstone.c Examining data/uftrace-0.9.4/check-deps/__have_libdw.c Examining data/uftrace-0.9.4/check-deps/__have_libelf.c Examining data/uftrace-0.9.4/check-deps/__have_libluajit.c Examining data/uftrace-0.9.4/check-deps/__have_libncurses.c Examining data/uftrace-0.9.4/check-deps/__have_libpython2.7.c Examining data/uftrace-0.9.4/check-deps/__have_libpython3.c Examining data/uftrace-0.9.4/check-deps/__perf_clockid.c Examining data/uftrace-0.9.4/check-deps/__perf_context_switch.c Examining data/uftrace-0.9.4/cmds/dump.c Examining data/uftrace-0.9.4/cmds/graph.c Examining data/uftrace-0.9.4/cmds/info.c Examining data/uftrace-0.9.4/cmds/live.c Examining data/uftrace-0.9.4/cmds/record.c Examining data/uftrace-0.9.4/cmds/recv.c Examining data/uftrace-0.9.4/cmds/replay.c Examining data/uftrace-0.9.4/cmds/report.c Examining data/uftrace-0.9.4/cmds/script.c Examining data/uftrace-0.9.4/cmds/tui.c Examining data/uftrace-0.9.4/libmcount/dynamic.c Examining data/uftrace-0.9.4/libmcount/event.c Examining data/uftrace-0.9.4/libmcount/internal.h Examining data/uftrace-0.9.4/libmcount/mcount-nop.c Examining data/uftrace-0.9.4/libmcount/mcount.c Examining data/uftrace-0.9.4/libmcount/mcount.h Examining data/uftrace-0.9.4/libmcount/misc.c Examining data/uftrace-0.9.4/libmcount/plthook.c Examining data/uftrace-0.9.4/libmcount/pmu.c Examining data/uftrace-0.9.4/libmcount/record.c Examining data/uftrace-0.9.4/libmcount/wrap.c Examining data/uftrace-0.9.4/libtraceevent/event-parse.c Examining data/uftrace-0.9.4/libtraceevent/event-parse.h Examining data/uftrace-0.9.4/libtraceevent/event-plugin.c Examining data/uftrace-0.9.4/libtraceevent/event-utils.h Examining data/uftrace-0.9.4/libtraceevent/include/asm/bug.h Examining data/uftrace-0.9.4/libtraceevent/include/linux/compiler.h Examining data/uftrace-0.9.4/libtraceevent/kbuffer-parse.c Examining data/uftrace-0.9.4/libtraceevent/kbuffer.h Examining data/uftrace-0.9.4/libtraceevent/parse-filter.c Examining data/uftrace-0.9.4/libtraceevent/parse-utils.c Examining data/uftrace-0.9.4/libtraceevent/trace-seq.c Examining data/uftrace-0.9.4/misc/demangler.c Examining data/uftrace-0.9.4/misc/prototypes.h Examining data/uftrace-0.9.4/misc/symbols.c Examining data/uftrace-0.9.4/tests/arch/arm/a.c Examining data/uftrace-0.9.4/tests/arch/arm/t.c Examining data/uftrace-0.9.4/tests/arch/arm/thumb.c Examining data/uftrace-0.9.4/tests/arch/x86_64/fentry.c Examining data/uftrace-0.9.4/tests/s-abc.c Examining data/uftrace-0.9.4/tests/s-alloca.c Examining data/uftrace-0.9.4/tests/s-allocfree.c Examining data/uftrace-0.9.4/tests/s-arg.c Examining data/uftrace-0.9.4/tests/s-autoargs.c Examining data/uftrace-0.9.4/tests/s-backtrace.cpp Examining data/uftrace-0.9.4/tests/s-chcpu.c Examining data/uftrace-0.9.4/tests/s-daemon.c Examining data/uftrace-0.9.4/tests/s-data.c Examining data/uftrace-0.9.4/tests/s-demangle.cpp Examining data/uftrace-0.9.4/tests/s-diff.c Examining data/uftrace-0.9.4/tests/s-dlopen.c Examining data/uftrace-0.9.4/tests/s-dlopen2.cpp Examining data/uftrace-0.9.4/tests/s-dwarf1.c Examining data/uftrace-0.9.4/tests/s-dwarf2.cpp Examining data/uftrace-0.9.4/tests/s-dwarf3.cpp Examining data/uftrace-0.9.4/tests/s-dynamic.c Examining data/uftrace-0.9.4/tests/s-dynmain.c Examining data/uftrace-0.9.4/tests/s-enum.c Examining data/uftrace-0.9.4/tests/s-exception.cpp Examining data/uftrace-0.9.4/tests/s-exception2.cpp Examining data/uftrace-0.9.4/tests/s-exception3.cpp Examining data/uftrace-0.9.4/tests/s-exception4.cpp Examining data/uftrace-0.9.4/tests/s-exit.c Examining data/uftrace-0.9.4/tests/s-exp-char.c Examining data/uftrace-0.9.4/tests/s-exp-float.c Examining data/uftrace-0.9.4/tests/s-exp-int.c Examining data/uftrace-0.9.4/tests/s-exp-mixed.c Examining data/uftrace-0.9.4/tests/s-exp-str.c Examining data/uftrace-0.9.4/tests/s-fibonacci.c Examining data/uftrace-0.9.4/tests/s-float-libcall.c Examining data/uftrace-0.9.4/tests/s-fork.c Examining data/uftrace-0.9.4/tests/s-fork2.c Examining data/uftrace-0.9.4/tests/s-forkexec.c Examining data/uftrace-0.9.4/tests/s-getids.c Examining data/uftrace-0.9.4/tests/s-hello.c Examining data/uftrace-0.9.4/tests/s-lib.c Examining data/uftrace-0.9.4/tests/s-libbar.cpp Examining data/uftrace-0.9.4/tests/s-libbaz.cpp Examining data/uftrace-0.9.4/tests/s-libdyn1.c Examining data/uftrace-0.9.4/tests/s-libdyn2.c Examining data/uftrace-0.9.4/tests/s-libfoo.cpp Examining data/uftrace-0.9.4/tests/s-libmain.c Examining data/uftrace-0.9.4/tests/s-longjmp.c Examining data/uftrace-0.9.4/tests/s-longjmp2.c Examining data/uftrace-0.9.4/tests/s-longjmp3.c Examining data/uftrace-0.9.4/tests/s-malloc-fork.c Examining data/uftrace-0.9.4/tests/s-malloc-hook.c Examining data/uftrace-0.9.4/tests/s-malloc-tsd.c Examining data/uftrace-0.9.4/tests/s-malloc.c Examining data/uftrace-0.9.4/tests/s-mmap.c Examining data/uftrace-0.9.4/tests/s-namespace.cpp Examining data/uftrace-0.9.4/tests/s-nest-libcall.c Examining data/uftrace-0.9.4/tests/s-nested.c Examining data/uftrace-0.9.4/tests/s-openclose.c Examining data/uftrace-0.9.4/tests/s-pltarg.c Examining data/uftrace-0.9.4/tests/s-posix_spawn.c Examining data/uftrace-0.9.4/tests/s-racycount.c Examining data/uftrace-0.9.4/tests/s-return.c Examining data/uftrace-0.9.4/tests/s-sdt.c Examining data/uftrace-0.9.4/tests/s-signal.c Examining data/uftrace-0.9.4/tests/s-signal2.c Examining data/uftrace-0.9.4/tests/s-sleep.c Examining data/uftrace-0.9.4/tests/s-sleep2.c Examining data/uftrace-0.9.4/tests/s-sort.c Examining data/uftrace-0.9.4/tests/s-std-string.cpp Examining data/uftrace-0.9.4/tests/s-taskname.c Examining data/uftrace-0.9.4/tests/s-thread-exec.c Examining data/uftrace-0.9.4/tests/s-thread-exit.c Examining data/uftrace-0.9.4/tests/s-thread-name.c Examining data/uftrace-0.9.4/tests/s-thread-tsd.c Examining data/uftrace-0.9.4/tests/s-thread.c Examining data/uftrace-0.9.4/tests/s-ucontext.c Examining data/uftrace-0.9.4/tests/s-unroll.c Examining data/uftrace-0.9.4/tests/s-variadic.c Examining data/uftrace-0.9.4/tests/s-vforkexec.c Examining data/uftrace-0.9.4/tests/unittest.c Examining data/uftrace-0.9.4/tests/unittest.h Examining data/uftrace-0.9.4/uftrace.c Examining data/uftrace-0.9.4/uftrace.h Examining data/uftrace-0.9.4/utils/arch.h Examining data/uftrace-0.9.4/utils/asm.h Examining data/uftrace-0.9.4/utils/auto-args.c Examining data/uftrace-0.9.4/utils/auto-args.h Examining data/uftrace-0.9.4/utils/compiler.h Examining data/uftrace-0.9.4/utils/data-file.c Examining data/uftrace-0.9.4/utils/debug.c Examining data/uftrace-0.9.4/utils/demangle.c Examining data/uftrace-0.9.4/utils/dwarf.c Examining data/uftrace-0.9.4/utils/dwarf.h Examining data/uftrace-0.9.4/utils/extern.c Examining data/uftrace-0.9.4/utils/field.c Examining data/uftrace-0.9.4/utils/field.h Examining data/uftrace-0.9.4/utils/filter.c Examining data/uftrace-0.9.4/utils/filter.h Examining data/uftrace-0.9.4/utils/fstack.c Examining data/uftrace-0.9.4/utils/fstack.h Examining data/uftrace-0.9.4/utils/graph.c Examining data/uftrace-0.9.4/utils/graph.h Examining data/uftrace-0.9.4/utils/kernel.c Examining data/uftrace-0.9.4/utils/kernel.h Examining data/uftrace-0.9.4/utils/list.h Examining data/uftrace-0.9.4/utils/pager.c Examining data/uftrace-0.9.4/utils/perf.c Examining data/uftrace-0.9.4/utils/perf.h Examining data/uftrace-0.9.4/utils/rbtree.c Examining data/uftrace-0.9.4/utils/rbtree.h Examining data/uftrace-0.9.4/utils/regs.c Examining data/uftrace-0.9.4/utils/report.c Examining data/uftrace-0.9.4/utils/report.h Examining data/uftrace-0.9.4/utils/script-luajit.c Examining data/uftrace-0.9.4/utils/script-luajit.h Examining data/uftrace-0.9.4/utils/script-python.c Examining data/uftrace-0.9.4/utils/script-python.h Examining data/uftrace-0.9.4/utils/script.c Examining data/uftrace-0.9.4/utils/script.h Examining data/uftrace-0.9.4/utils/session.c Examining data/uftrace-0.9.4/utils/symbol-libelf.c Examining data/uftrace-0.9.4/utils/symbol-libelf.h Examining data/uftrace-0.9.4/utils/symbol-rawelf.c Examining data/uftrace-0.9.4/utils/symbol-rawelf.h Examining data/uftrace-0.9.4/utils/symbol.c Examining data/uftrace-0.9.4/utils/symbol.h Examining data/uftrace-0.9.4/utils/utils.c Examining data/uftrace-0.9.4/utils/utils.h FINAL RESULTS: data/uftrace-0.9.4/misc/prototypes.h:499:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. int chmod(const char *pathname, enum uft_mode mode); data/uftrace-0.9.4/misc/prototypes.h:522:5: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. int chown(const char *path, uid_t uid, uid_t gid); data/uftrace-0.9.4/utils/utils.c:333:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(buf, uid, gid) < 0) data/uftrace-0.9.4/utils/utils.c:338:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(dirname, uid, gid) < 0) data/uftrace-0.9.4/utils/utils.c:349:9: [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. len = readlink("/proc/self/exe", exename, sizeof(exename)-1); data/uftrace-0.9.4/cmds/dump.c:243:8: [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 (sscanf(end, "pid=%d sid=%s", &tid, sid) != 2) data/uftrace-0.9.4/cmds/dump.c:244:5: [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(end, "tid=%d sid=%s", &tid, sid); data/uftrace-0.9.4/cmds/dump.c:750:39: [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. tid, rstack_type(frs), event->system, event->name, data/uftrace-0.9.4/cmds/info.c:986:2: [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(outfp, fmt, ap); data/uftrace-0.9.4/cmds/live.c:142:4: [4] (shell) execv: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execv(opts->exename, argv); data/uftrace-0.9.4/cmds/record.c:124: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(lib, F_OK) == 0) { data/uftrace-0.9.4/cmds/record.c:129:8: [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(lib, F_OK) == 0) data/uftrace-0.9.4/cmds/record.c:139:6: [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(lib, F_OK) == 0) data/uftrace-0.9.4/cmds/record.c:248:3: [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. snprintf(buf, sizeof(buf), "%"PRIu64, opts->threshold); data/uftrace-0.9.4/cmds/record.c:1401:6: [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(buf, F_OK) != 0) data/uftrace-0.9.4/cmds/record.c:1409:6: [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(logfile, F_OK) != 0) data/uftrace-0.9.4/cmds/record.c:2126:2: [4] (shell) execv: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execv(opts->exename, argv); data/uftrace-0.9.4/cmds/recv.c:511:3: [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. execvp(argv[0], argv); data/uftrace-0.9.4/cmds/replay.c:451:13: [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. ({ int _x = snprintf(args + n, len, fmt, ##__VA_ARGS__); n += _x; len -= _x; }) data/uftrace-0.9.4/cmds/tui.c:1531:14: [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. ({ int _x = snprintf(buf + len, sz - len, fmt, ## __VA_ARGS__); len += _x; }) data/uftrace-0.9.4/cmds/tui.c:2269:6: [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(dloc->file->name, R_OK) < 0) data/uftrace-0.9.4/cmds/tui.c:2302:3: [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. execvp(editor_strv.p[0], editor_strv.p); data/uftrace-0.9.4/libmcount/misc.c:79:3: [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. snprintf(session, sizeof(session), "%0*"PRIx64, data/uftrace-0.9.4/libmcount/record.c:33:2: [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. snprintf(sess_id, size, SHMEM_SESSION_FMT, mcount_session_name(), tid, idx); data/uftrace-0.9.4/libmcount/record.c:85:2: [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. snprintf(buf, sizeof(buf), SHMEM_SESSION_FMT, data/uftrace-0.9.4/libmcount/record.c:162:2: [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. snprintf(buf, sizeof(buf), SHMEM_SESSION_FMT, data/uftrace-0.9.4/libmcount/record.c:189:2: [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. snprintf(buf, sizeof(buf), SHMEM_SESSION_FMT, data/uftrace-0.9.4/libmcount/record.c:554:6: [4] (buffer) fscanf: 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. if (fscanf(fp, "%"SCNu64" %"SCNu64" %"SCNu64, data/uftrace-0.9.4/libmcount/record.c:1128:7: [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 (sscanf(buf, "%lx-%lx %s %"SCNx64" %hhx:%hhx %u %s\n", data/uftrace-0.9.4/libtraceevent/event-parse.c:59:35: [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. warning("[%s:%s] " fmt, event->system, \ data/uftrace-0.9.4/libtraceevent/event-parse.c:852:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(newtok, buf); data/uftrace-0.9.4/libtraceevent/event-parse.c:854:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(newtok, buf); data/uftrace-0.9.4/libtraceevent/event-parse.c:1361:6: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(field->type, last_token); data/uftrace-0.9.4/libtraceevent/event-parse.c:1414:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(brackets, token); data/uftrace-0.9.4/libtraceevent/event-parse.c:1454:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(field->type, field->name); data/uftrace-0.9.4/libtraceevent/event-parse.c:1457:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(field->type, brackets); data/uftrace-0.9.4/libtraceevent/event-parse.c:1470:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(field->type, brackets); data/uftrace-0.9.4/libtraceevent/event-parse.c:2898:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(atom, token); data/uftrace-0.9.4/libtraceevent/event-parse.c:3310:42: [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. (!sys || strcmp(pevent->last_event->system, sys) == 0)) data/uftrace-0.9.4/libtraceevent/event-parse.c:3318:22: [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 (strcmp(event->system, sys) == 0) data/uftrace-0.9.4/libtraceevent/event-parse.c:4750:22: [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. res = strcmp((*ea)->system, (*eb)->system); data/uftrace-0.9.4/libtraceevent/event-parse.c:4750:37: [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. res = strcmp((*ea)->system, (*eb)->system); data/uftrace-0.9.4/libtraceevent/event-parse.c:4763:22: [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. res = strcmp((*ea)->system, (*eb)->system); data/uftrace-0.9.4/libtraceevent/event-parse.c:4763:37: [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. res = strcmp((*ea)->system, (*eb)->system); data/uftrace-0.9.4/libtraceevent/event-parse.c:5109:43: [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 (sys_name && (strcmp(sys_name, event->system) != 0)) data/uftrace-0.9.4/libtraceevent/event-parse.c:5201:14: [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 (!event->system) { data/uftrace-0.9.4/libtraceevent/event-parse.c:5263:14: [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. free(event->system); data/uftrace-0.9.4/libtraceevent/event-parse.c:5737:44: [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 (sys_name && (strcmp(sys_name, event->system) != 0)) data/uftrace-0.9.4/libtraceevent/event-parse.c:5862:22: [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. event->id, event->system, event->name); data/uftrace-0.9.4/libtraceevent/event-parse.c:5926:14: [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. free(event->system); data/uftrace-0.9.4/libtraceevent/event-parse.h:85:26: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, 2, 3))); data/uftrace-0.9.4/libtraceevent/event-parse.h:87:26: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, 2, 0))); data/uftrace-0.9.4/libtraceevent/event-parse.h:315:10: [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. char *system; data/uftrace-0.9.4/libtraceevent/event-plugin.c:81:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s:%s", alias, op->name); data/uftrace-0.9.4/libtraceevent/event-plugin.c:252:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(plugin, path); data/uftrace-0.9.4/libtraceevent/event-plugin.c:254:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(plugin, file); data/uftrace-0.9.4/libtraceevent/event-plugin.c:382:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path, home); data/uftrace-0.9.4/libtraceevent/event-plugin.c:384:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(path, LOCAL_PLUGIN_DIR); data/uftrace-0.9.4/libtraceevent/include/asm/bug.h:6:36: [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. #define __WARN_printf(arg...) do { fprintf(stderr, arg); } while (0) data/uftrace-0.9.4/libtraceevent/parse-filter.c:54:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(error_buf, input); data/uftrace-0.9.4/libtraceevent/parse-filter.c:64:2: [4] (format) vsnprintf: 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. vsnprintf(error_buf + len, PEVENT_FILTER_ERROR_BUFSZ - len, fmt, ap); data/uftrace-0.9.4/libtraceevent/parse-filter.c:258:32: [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. return !regexec(sreg, event->system, 0, NULL, 0) && data/uftrace-0.9.4/libtraceevent/parse-filter.c:262:31: [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. return !regexec(ereg, event->system, 0, NULL, 0) || data/uftrace-0.9.4/libtraceevent/parse-filter.c:289:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(reg, "^%s$", event_name); data/uftrace-0.9.4/libtraceevent/parse-filter.c:304:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(reg, "^%s$", sys_name); data/uftrace-0.9.4/libtraceevent/parse-filter.c:1472:28: [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. sys = filter_type->event->system; data/uftrace-0.9.4/libtraceevent/parse-filter.c:1575: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. event->system, data/uftrace-0.9.4/libtraceevent/parse-utils.c:35:2: [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(stderr, fmt, ap); data/uftrace-0.9.4/libtraceevent/parse-utils.c:60:2: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/uftrace-0.9.4/libtraceevent/trace-seq.c:136:8: [4] (format) vsnprintf: 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. ret = vsnprintf(s->buffer + s->len, len, fmt, ap); data/uftrace-0.9.4/libtraceevent/trace-seq.c:171:8: [4] (format) vsnprintf: 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. ret = vsnprintf(s->buffer + s->len, len, fmt, args); data/uftrace-0.9.4/misc/prototypes.h:113:7: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). char* strcat(char *dest, const char *src); data/uftrace-0.9.4/misc/prototypes.h:115:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). void strcpy(void* dest, const char* src); data/uftrace-0.9.4/misc/prototypes.h:159:5: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. int printf(const char *format, ...); data/uftrace-0.9.4/misc/prototypes.h:160:5: [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. int fprintf(FILE *stream, const char *format, ...); data/uftrace-0.9.4/misc/prototypes.h:162:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. int sprintf(void *dest, const char *format, ...); data/uftrace-0.9.4/misc/prototypes.h:163:5: [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. int snprintf(void *dest, size_t size, const char *format, ...); data/uftrace-0.9.4/misc/prototypes.h:263:5: [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. int access(const char *pathname, enum uft_access_flag mode); data/uftrace-0.9.4/misc/prototypes.h:289:5: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int execl(const char *path, const char *arg, ...); data/uftrace-0.9.4/misc/prototypes.h:290:5: [4] (shell) execlp: 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. int execlp(const char *file, const char *arg, ...); data/uftrace-0.9.4/misc/prototypes.h:291:5: [4] (shell) execle: 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. int execle(const char *path, const char *arg, ...); data/uftrace-0.9.4/misc/prototypes.h:294:5: [4] (shell) execv: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int execv(const char *path, ...); data/uftrace-0.9.4/misc/prototypes.h:296:5: [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. int execvp(const char *file, ...); data/uftrace-0.9.4/misc/symbols.c:121:4: [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 + 5, "timestamp=%lu.%lu %*[^i]id=%d sid=%s", data/uftrace-0.9.4/misc/symbols.c:144:4: [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(line + 5, "timestamp=%lu.%lu tid=%d sid=%s base=%"PRIx64, data/uftrace-0.9.4/misc/symbols.c:214:4: [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(argv[i], "%"PRIx64, &addr); data/uftrace-0.9.4/misc/symbols.c:227:4: [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(buf, "%"PRIx64, &addr); data/uftrace-0.9.4/tests/s-forkexec.c:20:4: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(TEST_PROG1, TEST_PROG1, NULL); data/uftrace-0.9.4/tests/s-forkexec.c:22:4: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(TEST_PROG2, TEST_PROG2, NULL); data/uftrace-0.9.4/tests/s-thread-exec.c:8:2: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(exename, exename, NULL); data/uftrace-0.9.4/tests/s-variadic.c:11:8: [4] (format) vsnprintf: 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. ret = vsnprintf(buf, sizeof(buf), fmt, ap); data/uftrace-0.9.4/tests/s-vforkexec.c:17:3: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(TEST_PROG, TEST_PROG, NULL); data/uftrace-0.9.4/uftrace.c:1072:5: [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. !access("./info", F_OK)) { data/uftrace-0.9.4/utils/data-file.c:156:10: [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. num = sscanf(line + 5, "timestamp=%lu.%lu %*[^i]id=%d sid=%s", data/uftrace-0.9.4/utils/data-file.c:185:10: [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. num = sscanf(line + 5, "timestamp=%lu.%lu tid=%d sid=%s base=%"PRIx64, data/uftrace-0.9.4/utils/data-file.c:259:4: [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 + 7, "%u %[^:]:%s", data/uftrace-0.9.4/utils/data-file.c:279:2: [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. snprintf(buf, sz, "%"PRIu64".%09"PRIu64, // sec.nsec data/uftrace-0.9.4/utils/debug.c:97:8: [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(buf, X_OK)) { data/uftrace-0.9.4/utils/debug.c:156:2: [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(logfp, fmt, ap); data/uftrace-0.9.4/utils/debug.c:169:2: [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(logfp, fmt, ap); data/uftrace-0.9.4/utils/debug.c:186:2: [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(logfp, fmt, ap); data/uftrace-0.9.4/utils/debug.c:203:2: [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(logfp, fmt, ap); data/uftrace-0.9.4/utils/debug.c:214:2: [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(outfp, fmt, ap); data/uftrace-0.9.4/utils/debug.c:232:2: [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(outfp, fmt, ap); data/uftrace-0.9.4/utils/dwarf.c:613:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(spec, sz); data/uftrace-0.9.4/utils/dwarf.c:621:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(spec, data.enum_name); data/uftrace-0.9.4/utils/dwarf.c:714:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(spec, buf); data/uftrace-0.9.4/utils/dwarf.c:719:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(spec, buf); data/uftrace-0.9.4/utils/extern.c:97:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(extn->msg, pos); data/uftrace-0.9.4/utils/fstack.c:1334:40: [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. xasprintf(&evt_name, "%s:%s", event->system, event->name); data/uftrace-0.9.4/utils/kernel.c:265: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(filename, F_OK)) data/uftrace-0.9.4/utils/kernel.c:286:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(kfilter->name, name); data/uftrace-0.9.4/utils/kernel.c:391:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(kevent->name, name); data/uftrace-0.9.4/utils/kernel.c:574:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(kfilter->name, name); data/uftrace-0.9.4/utils/kernel.c:1097:4: [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(buf, "%[^:]: %s\n", name, val); data/uftrace-0.9.4/utils/pager.c:53:3: [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. execvp(argv[0], (char *const*) argv); data/uftrace-0.9.4/utils/pager.c:84: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. if (!(pager || access("/usr/bin/pager", X_OK))) data/uftrace-0.9.4/utils/pager.c:86: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. if (!(pager || access("/usr/bin/less", X_OK))) data/uftrace-0.9.4/utils/script.c:103:6: [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(script_pathname, F_OK) < 0) { data/uftrace-0.9.4/utils/session.c:49:7: [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 (sscanf(buf, "%"PRIx64"-%"PRIx64" %s %*x %*x:%*x %*d %s\n", data/uftrace-0.9.4/utils/symbol.c:929:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(sym->name, name); data/uftrace-0.9.4/utils/symbol.c:1002: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(symfile, F_OK) == 0) { data/uftrace-0.9.4/utils/symbol.c:1047:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(m->name, mod_name); data/uftrace-0.9.4/utils/symbol.c:1610:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(map->libname, exename); data/uftrace-0.9.4/utils/utils.c:209: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(info_path, F_OK)) data/uftrace-0.9.4/utils/utils.c:239:6: [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, F_OK) != 0) data/uftrace-0.9.4/utils/utils.c:546:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(new + llen, delim); data/uftrace-0.9.4/utils/utils.c:548:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(new + len - rlen - 1, right); data/uftrace-0.9.4/cmds/info.c:61:12: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. exename = realpath(fha->opts->exename, fha->buf); data/uftrace-0.9.4/cmds/live.c:65:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *envbuf = getenv("LD_LIBRARY_PATH"); data/uftrace-0.9.4/cmds/live.c:83: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. old_preload = getenv("LD_PRELOAD"); data/uftrace-0.9.4/cmds/record.c:72:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_FILTER") || getenv("UFTRACE_TRIGGER") || data/uftrace-0.9.4/cmds/record.c:72:37: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_FILTER") || getenv("UFTRACE_TRIGGER") || data/uftrace-0.9.4/cmds/record.c:73: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. getenv("UFTRACE_ARGUMENT") || getenv("UFTRACE_RETVAL") || data/uftrace-0.9.4/cmds/record.c:73:37: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. getenv("UFTRACE_ARGUMENT") || getenv("UFTRACE_RETVAL") || data/uftrace-0.9.4/cmds/record.c:74: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. getenv("UFTRACE_PATCH") || getenv("UFTRACE_SCRIPT") || data/uftrace-0.9.4/cmds/record.c:74:37: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. getenv("UFTRACE_PATCH") || getenv("UFTRACE_SCRIPT") || data/uftrace-0.9.4/cmds/record.c:75: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. getenv("UFTRACE_AUTO_ARGS") || getenv("UFTRACE_WATCH") || data/uftrace-0.9.4/cmds/record.c:75:37: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. getenv("UFTRACE_AUTO_ARGS") || getenv("UFTRACE_WATCH") || data/uftrace-0.9.4/cmds/record.c:76: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. getenv("UFTRACE_CALLER") || getenv("UFTRACE_SIGNAL")) data/uftrace-0.9.4/cmds/record.c:76:37: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. getenv("UFTRACE_CALLER") || getenv("UFTRACE_SIGNAL")) data/uftrace-0.9.4/cmds/record.c:158:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *envbuf = getenv("LD_LIBRARY_PATH"); data/uftrace-0.9.4/cmds/record.c:342: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. old_preload = getenv("LD_PRELOAD"); data/uftrace-0.9.4/cmds/record.c:1520: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. char *env = getenv("PATH"); data/uftrace-0.9.4/cmds/record.c:2086:6: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath(opts->dirname, fullpath) != NULL) data/uftrace-0.9.4/cmds/tui.c:2256:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *editor = getenv("EDITOR"); data/uftrace-0.9.4/libmcount/dynamic.c:476: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. size_filter = getenv("UFTRACE_PATCH_SIZE"); data/uftrace-0.9.4/libmcount/mcount.c:102:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_SRCLINE") == NULL) data/uftrace-0.9.4/libmcount/mcount.c:377:24: [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 *filter_str = getenv("UFTRACE_FILTER"); data/uftrace-0.9.4/libmcount/mcount.c:378:24: [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 *trigger_str = getenv("UFTRACE_TRIGGER"); data/uftrace-0.9.4/libmcount/mcount.c:379:24: [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 *argument_str = getenv("UFTRACE_ARGUMENT"); data/uftrace-0.9.4/libmcount/mcount.c:380:24: [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 *retval_str = getenv("UFTRACE_RETVAL"); data/uftrace-0.9.4/libmcount/mcount.c:381:24: [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 *autoargs_str = getenv("UFTRACE_AUTO_ARGS"); data/uftrace-0.9.4/libmcount/mcount.c:382:24: [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 *caller_str = getenv("UFTRACE_CALLER"); data/uftrace-0.9.4/libmcount/mcount.c:395: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. mcount_signal_init(getenv("UFTRACE_SIGNAL"), &filter_setting); data/uftrace-0.9.4/libmcount/mcount.c:405:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_SRCLINE")) data/uftrace-0.9.4/libmcount/mcount.c:448:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_DEPTH")) data/uftrace-0.9.4/libmcount/mcount.c:449:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. mcount_depth = strtol(getenv("UFTRACE_DEPTH"), NULL, 0); data/uftrace-0.9.4/libmcount/mcount.c:451:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_DISABLED")) data/uftrace-0.9.4/libmcount/mcount.c:483: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 *watch_str = getenv("UFTRACE_WATCH"); data/uftrace-0.9.4/libmcount/mcount.c:1638:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. cmds_str = getenv("UFTRACE_ARGS"); data/uftrace-0.9.4/libmcount/mcount.c:1678:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. pipefd_str = getenv("UFTRACE_PIPE"); data/uftrace-0.9.4/libmcount/mcount.c:1679: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. logfd_str = getenv("UFTRACE_LOGFD"); data/uftrace-0.9.4/libmcount/mcount.c:1680: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. debug_str = getenv("UFTRACE_DEBUG"); data/uftrace-0.9.4/libmcount/mcount.c:1681: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. bufsize_str = getenv("UFTRACE_BUFFER"); data/uftrace-0.9.4/libmcount/mcount.c:1682:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. maxstack_str = getenv("UFTRACE_MAX_STACK"); data/uftrace-0.9.4/libmcount/mcount.c:1683: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. color_str = getenv("UFTRACE_COLOR"); data/uftrace-0.9.4/libmcount/mcount.c:1684:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. threshold_str = getenv("UFTRACE_THRESHOLD"); data/uftrace-0.9.4/libmcount/mcount.c:1685:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. demangle_str = getenv("UFTRACE_DEMANGLE"); data/uftrace-0.9.4/libmcount/mcount.c:1686: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. plthook_str = getenv("UFTRACE_PLTHOOK"); data/uftrace-0.9.4/libmcount/mcount.c:1687: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. patch_str = getenv("UFTRACE_PATCH"); data/uftrace-0.9.4/libmcount/mcount.c:1688: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. event_str = getenv("UFTRACE_EVENT"); data/uftrace-0.9.4/libmcount/mcount.c:1689:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. script_str = getenv("UFTRACE_SCRIPT"); data/uftrace-0.9.4/libmcount/mcount.c:1690:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. nest_libcall = !!getenv("UFTRACE_NEST_LIBCALL"); data/uftrace-0.9.4/libmcount/mcount.c:1691: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. pattern_str = getenv("UFTRACE_PATTERN"); data/uftrace-0.9.4/libmcount/mcount.c:1710: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. build_debug_domain(getenv("UFTRACE_DEBUG_DOMAIN")); data/uftrace-0.9.4/libmcount/mcount.c:1723: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. dirname = getenv("UFTRACE_DIR"); data/uftrace-0.9.4/libmcount/mcount.c:1744:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_LIST_EVENT")) { data/uftrace-0.9.4/libmcount/mcount.c:1784:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("UFTRACE_KERNEL_PID_UPDATE")) data/uftrace-0.9.4/libmcount/misc.c:73:4: [3] (random) srandom: 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. srandom(time(NULL)); data/uftrace-0.9.4/libmcount/misc.c:74:17: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. session_id = random(); data/uftrace-0.9.4/libmcount/misc.c:76:18: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. session_id |= random(); data/uftrace-0.9.4/libmcount/plthook.c:268:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("LD_BIND_NOT")) data/uftrace-0.9.4/libmcount/wrap.c:81:6: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. p = realpath(info->dlpi_name, buf); data/uftrace-0.9.4/libmcount/wrap.c:173:7: [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(uftrace_env[i])) data/uftrace-0.9.4/libmcount/wrap.c:183:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env_val = getenv(uftrace_env[i]); data/uftrace-0.9.4/libtraceevent/event-plugin.c:364:11: [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. envdir = getenv("TRACEEVENT_PLUGIN_DIR"); data/uftrace-0.9.4/libtraceevent/event-plugin.c:372: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. home = getenv("HOME"); data/uftrace-0.9.4/misc/prototypes.h:177:7: [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 *getenv(const char *name); data/uftrace-0.9.4/misc/prototypes.h:483:5: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt(int argc, void *argv, const char * optstr); data/uftrace-0.9.4/misc/prototypes.h:485:5: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int getopt_long(int argc, void *argv, const char * optstr); data/uftrace-0.9.4/tests/s-pltarg.c:6:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *path = getenv("HOME"); data/uftrace-0.9.4/tests/unittest.c:263:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "dvnpiO:f:")) != -1) { data/uftrace-0.9.4/tests/unittest.c:279: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. term = getenv("TERM"); data/uftrace-0.9.4/utils/debug.c:93:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. strv_split(&path_strv, getenv("PATH"), ":"); data/uftrace-0.9.4/utils/debug.c:105:9: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. path = realpath(pager, NULL); data/uftrace-0.9.4/utils/debug.c:117: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. char *term = getenv("TERM"); data/uftrace-0.9.4/utils/pager.c:80: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. char *pager = getenv("PAGER"); data/uftrace-0.9.4/utils/script-python.c:195: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. char *old_sysdir = getenv("PYTHONPATH"); data/uftrace-0.9.4/utils/session.c:700:7: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. t = random() % (NUM_TEST * 100); data/uftrace-0.9.4/utils/utils.c:314:11: [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. uidstr = getenv("SUDO_UID"); data/uftrace-0.9.4/utils/utils.c:315:11: [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. gidstr = getenv("SUDO_GID"); data/uftrace-0.9.4/utils/utils.c:859:6: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath(path, resolved_path) == NULL) data/uftrace-0.9.4/arch/aarch64/cpuinfo.c:6: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[1024]; data/uftrace-0.9.4/arch/aarch64/cpuinfo.c:10: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("/proc/cpuinfo", "r"); data/uftrace-0.9.4/arch/aarch64/mcount-dynamic.c:34: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(&jmp_insn[4], &info->insns[24], 8); data/uftrace-0.9.4/arch/aarch64/mcount-dynamic.c:81:2: [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((void *)mdi->trampoline, trampoline, sizeof(trampoline)); data/uftrace-0.9.4/arch/aarch64/mcount-dynamic.c:121:2: [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(insn, &push, sizeof(push)); data/uftrace-0.9.4/arch/aarch64/mcount-dynamic.c:122:2: [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(insn+4, &call, sizeof(call)); data/uftrace-0.9.4/arch/aarch64/mcount-dynamic.c:140:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(addr, saved_insn, CODE_SIZE); data/uftrace-0.9.4/arch/aarch64/mcount-insn.c:210: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(info->insns, &ldr_insn, sizeof(ldr_insn)); data/uftrace-0.9.4/arch/aarch64/mcount-insn.c:212: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(info->insns + 24, &target_addr, sizeof(target_addr)); data/uftrace-0.9.4/arch/aarch64/mcount-insn.c:254:4: [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(info->insns + info->copy_size, insn[i].bytes, insn[i].size); data/uftrace-0.9.4/arch/aarch64/mcount-insn.c:307:2: [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(info->insns, insn, INSN_SIZE); data/uftrace-0.9.4/arch/aarch64/mcount-support.c:145: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(ctx->val.v, addr, spec->size); data/uftrace-0.9.4/arch/aarch64/mcount-support.c:186: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(ctx->val.v, ctx->retval, spec->size); data/uftrace-0.9.4/arch/arm/cpuinfo.c:6: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[1024]; data/uftrace-0.9.4/arch/arm/cpuinfo.c:10: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("/proc/cpuinfo", "r"); data/uftrace-0.9.4/arch/arm/mcount-support.c:457: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(ctx->val.v, addr, spec->size); data/uftrace-0.9.4/arch/arm/mcount-support.c:492: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(ctx->val.v, ctx->retval - 2, spec->size); data/uftrace-0.9.4/arch/arm/mcount-support.c:496: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(ctx->val.v, ctx->retval, spec->size); data/uftrace-0.9.4/arch/i386/cpuinfo.c:6: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[1024]; data/uftrace-0.9.4/arch/i386/cpuinfo.c:10: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("/proc/cpuinfo", "r"); data/uftrace-0.9.4/arch/i386/mcount-dynamic.c:50:2: [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((void *)mdi->trampoline, trampoline, sizeof(trampoline)); data/uftrace-0.9.4/arch/i386/mcount-dynamic.c:51:2: [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((void *)mdi->trampoline + sizeof(trampoline), data/uftrace-0.9.4/arch/i386/mcount-dynamic.c:97:2: [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(&insn[1], &target_addr, sizeof(target_addr)); data/uftrace-0.9.4/arch/i386/mcount-support.c:111: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(ctx->val.v, addr, spec->size); data/uftrace-0.9.4/arch/i386/mcount-support.c:130: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(ctx->val.v, ctx->retval, spec->size); data/uftrace-0.9.4/arch/x86_64/cpuinfo.c:6: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[1024]; data/uftrace-0.9.4/arch/x86_64/cpuinfo.c:10: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("/proc/cpuinfo", "r"); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:98: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((void *)mdi->trampoline, trampoline, sizeof(trampoline)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:99: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((void *)mdi->trampoline + sizeof(trampoline), data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:103: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((void *)mdi->trampoline + 16, trampoline, sizeof(trampoline)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:104: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((void *)mdi->trampoline + 16 + sizeof(trampoline), data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:109: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((void *)mdi->trampoline, trampoline, sizeof(trampoline)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:110: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((void *)mdi->trampoline + sizeof(trampoline), data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:118: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((void *)mdi->trampoline, trampoline, sizeof(trampoline)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:119: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((void *)mdi->trampoline + sizeof(trampoline), data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:279:2: [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(&insn[1], &target_addr, sizeof(target_addr)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:300: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 bytes[8]; data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:312: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(func + 5, nop6, sizeof(nop6)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:316: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(&patch.bytes[1], &target_addr, sizeof(target_addr)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:317: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(&patch.bytes[5], nop6, 3); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:319: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(func, patch.bytes, sizeof(patch)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:327: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(func + 5, nop4, sizeof(nop4)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:331: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(&patch.bytes[1], &target_addr, sizeof(target_addr)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:332: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(&patch.bytes[5], nop4, 3); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:334: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(func, patch.bytes, sizeof(patch)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:429:2: [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(&call_insn[1], &target_addr, CALL_INSN_SIZE - 1); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:450:2: [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(origin_code_addr, call_insn, CALL_INSN_SIZE); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:489:2: [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(jmp_insn + JMP_INSN_SIZE, &jmp_target, sizeof(jmp_target)); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:523:2: [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(insn, nop_insn, nop_size); data/uftrace-0.9.4/arch/x86_64/mcount-dynamic.c:629:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(addr, moi->orig, moi->orig_size); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:142:2: [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(&mov_insns[IMM], &PC_base, sizeof(PC_base)); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:144:2: [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(insns, mov_insns, sizeof(mov_insns)); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:186:2: [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(&insns[0], push, sizeof(push)); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:187:2: [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(&insns[6], jump, sizeof(jump)); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:188:2: [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(&insns[12], &ret_addr, sizeof(ret_addr)); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:189:2: [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(&insns[20], &target, sizeof(target)); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:226:2: [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(insns, insn->bytes, res); data/uftrace-0.9.4/arch/x86_64/mcount-insn.c:411: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(info->insns + info->copy_size, insns_byte, size); data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:76:2: [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(trampoline, tramp_plt0, sizeof(tramp_plt0)); data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:78:2: [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(tramp, &pd->module_id, sizeof(pd->module_id)); data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:80:2: [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(tramp, &plthook_addr, sizeof(plthook_addr)); data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:102: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(tramp, tramp_insns, TRAMP_ENT_SIZE); data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:105: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(tramp + TRAMP_IDX_OFFSET, &i, sizeof(i)); data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:109: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(tramp + TRAMP_JMP_OFFSET, &pcrel, sizeof(pcrel)); data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:113: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(&pd->resolved_addr[i], (void *)rela->r_offset + offset, data/uftrace-0.9.4/arch/x86_64/mcount-noplt.c:116: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((void *)rela->r_offset + offset, &tramp, sizeof(long)); data/uftrace-0.9.4/arch/x86_64/mcount-support.c:116: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(ctx->val.v, addr, spec->size); data/uftrace-0.9.4/arch/x86_64/mcount-support.c:135: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(ctx->val.v, ctx->retval, spec->size); data/uftrace-0.9.4/arch/x86_64/symbol.c:36:4: [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(&rel_iter, &sec_iter, sizeof(sec_iter)); data/uftrace-0.9.4/arch/x86_64/symbol.c:44:4: [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(&sym_iter, &sec_iter, sizeof(sec_iter)); data/uftrace-0.9.4/cmds/dump.c:107: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[PATH_MAX]; data/uftrace-0.9.4/cmds/dump.c:114: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(buf, "r"); data/uftrace-0.9.4/cmds/dump.c:176:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/uftrace-0.9.4/cmds/dump.c:180: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 sid[20]; data/uftrace-0.9.4/cmds/dump.c:183: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(buf, "r"); data/uftrace-0.9.4/cmds/dump.c:340:5: [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(buf, "NULL"); data/uftrace-0.9.4/cmds/dump.c:354:4: [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(&val, ptr, spec->size); data/uftrace-0.9.4/cmds/dump.c:383:4: [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(&val, ptr, spec->size); data/uftrace-0.9.4/cmds/dump.c:396:4: [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(&val, ptr, spec->size); data/uftrace-0.9.4/cmds/dump.c:437:5: [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(buf, "NULL"); data/uftrace-0.9.4/cmds/dump.c:451:4: [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(&val, ptr, spec->size); data/uftrace-0.9.4/cmds/dump.c:466:4: [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(&val, ptr, spec->size); data/uftrace-0.9.4/cmds/dump.c:542: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[1024]; data/uftrace-0.9.4/cmds/dump.c:697:4: [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(&lower, tmp, 4); data/uftrace-0.9.4/cmds/dump.c:698:4: [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(&upper, tmp + 4, 4); data/uftrace-0.9.4/cmds/dump.c:862: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 spec_buf[1024]; data/uftrace-0.9.4/cmds/dump.c:985: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[PATH_MAX]; data/uftrace-0.9.4/cmds/dump.c:1089: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 *names[opts->max_stack]; data/uftrace-0.9.4/cmds/graph.c:333:2: [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(bt->addr, addrs, len * sizeof(*addrs)); data/uftrace-0.9.4/cmds/info.c:33: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[PATH_MAX]; data/uftrace-0.9.4/cmds/info.c:42: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[PATH_MAX]; data/uftrace-0.9.4/cmds/info.c:89:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char build_id[BUILD_ID_SIZE]; data/uftrace-0.9.4/cmds/info.c:90: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 build_id_str[BUILD_ID_STR_SIZE]; data/uftrace-0.9.4/cmds/info.c:122:4: [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(build_id, iter.note_desc, BUILD_ID_SIZE); data/uftrace-0.9.4/cmds/info.c:130: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(&build_id_str[offset*2], "%02x", c); data/uftrace-0.9.4/cmds/info.c:157: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 build_id_str[BUILD_ID_STR_SIZE]; data/uftrace-0.9.4/cmds/info.c:167:2: [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(build_id_str, &buf[9], BUILD_ID_STR_SIZE - 1); data/uftrace-0.9.4/cmds/info.c:217: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("/proc/self/cmdline", "r"); data/uftrace-0.9.4/cmds/info.c:347: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("/proc/meminfo", "r"); data/uftrace-0.9.4/cmds/info.c:414: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("/etc/os-release", "r"); data/uftrace-0.9.4/cmds/info.c:427: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("/etc/lsb-release", "r"); data/uftrace-0.9.4/cmds/info.c:657: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/uftrace-0.9.4/cmds/info.c:994: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[PATH_MAX]; data/uftrace-0.9.4/cmds/info.c:1092: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 bid[BUILD_ID_SIZE * 2 + 1]; data/uftrace-0.9.4/cmds/info.c:1153: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 flags[6] = " "; data/uftrace-0.9.4/cmds/live.c:100: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 template[32] = "/tmp/uftrace-live-XXXXXX"; data/uftrace-0.9.4/cmds/live.c:110:8: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(template); data/uftrace-0.9.4/cmds/live.c:115:9: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(template + sizeof("/tmp/") - 1); data/uftrace-0.9.4/cmds/record.c:39: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[SHMEM_NAME_SIZE]; data/uftrace-0.9.4/cmds/record.c:84: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. static char domain[2*DBG_DOMAIN_MAX + 1]; data/uftrace-0.9.4/cmds/record.c:153: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[PATH_MAX]; data/uftrace-0.9.4/cmds/record.c:412: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 elf_ident[EI_NIDENT]; data/uftrace-0.9.4/cmds/record.c:417: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(filename, O_WRONLY | O_CREAT| O_TRUNC, 0644); data/uftrace-0.9.4/cmds/record.c:421: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). efd = open(opts->exename, O_RDONLY); data/uftrace-0.9.4/cmds/record.c:507: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(filename, O_WRONLY | O_CREAT | O_APPEND, 0644); data/uftrace-0.9.4/cmds/record.c:901:8: [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 shmem_session[20]; data/uftrace-0.9.4/cmds/record.c:915: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 sid[128]; data/uftrace-0.9.4/cmds/record.c:927:4: [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(&sid[1], shmem_bufs[i]->d_name, MSG_ID_SIZE); data/uftrace-0.9.4/cmds/record.c:1014: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[128]; data/uftrace-0.9.4/cmds/record.c:1019: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[PATH_MAX]; data/uftrace-0.9.4/cmds/record.c:1026: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(buf, O_RDONLY); data/uftrace-0.9.4/cmds/record.c:1067: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[128]; data/uftrace-0.9.4/cmds/record.c:1226: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(buf, sess.sid, 16); data/uftrace-0.9.4/cmds/record.c:1366: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(filename, O_RDONLY); data/uftrace-0.9.4/cmds/record.c:1397: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[PATH_MAX]; data/uftrace-0.9.4/cmds/record.c:1432: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 sid[20]; data/uftrace-0.9.4/cmds/record.c:1553: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 elf_ident[EI_NIDENT]; data/uftrace-0.9.4/cmds/record.c:1567: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(opts->exename, O_RDONLY); data/uftrace-0.9.4/cmds/record.c:2029: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). wd.pipefd = open(channel, O_RDONLY | O_NONBLOCK); data/uftrace-0.9.4/cmds/record.c:2073: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 fullpath[PATH_MAX]; data/uftrace-0.9.4/cmds/recv.c:205: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(pathname, O_RDONLY); data/uftrace-0.9.4/cmds/recv.c:290: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[PATH_MAX]; data/uftrace-0.9.4/cmds/recv.c:293: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(buf, O_CLIENT_FLAGS, 0644); data/uftrace-0.9.4/cmds/recv.c:312: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 dirname[len + 1]; data/uftrace-0.9.4/cmds/recv.c:535: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 hbuf[NI_MAXHOST]; data/uftrace-0.9.4/cmds/replay.c:499: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. unsigned char v[16]; data/uftrace-0.9.4/cmds/replay.c:511:4: [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(args, "()"); data/uftrace-0.9.4/cmds/replay.c:528: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 fmtstr[16]; data/uftrace-0.9.4/cmds/replay.c:546:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/cmds/replay.c:572:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/cmds/replay.c:586:4: [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(&slen, data, 2); data/uftrace-0.9.4/cmds/replay.c:589:4: [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(str, data + 2, slen); data/uftrace-0.9.4/cmds/replay.c:643:4: [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(&c, data, 1); data/uftrace-0.9.4/cmds/replay.c:664:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/cmds/replay.c:687:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/cmds/replay.c:709:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/cmds/replay.c:740:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(val.v, data, spec->size); data/uftrace-0.9.4/cmds/replay.c:782: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 args[1024]; data/uftrace-0.9.4/cmds/replay.c:862: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 retval[1024]; data/uftrace-0.9.4/cmds/report.c:253: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[10]; data/uftrace-0.9.4/cmds/report.c:317: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(&node->total, &node->self, sizeof(node->self)); data/uftrace-0.9.4/cmds/report.c:347: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[10]; data/uftrace-0.9.4/cmds/tui.c:1023:2: [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(graph->disp_mask, graph->top_mask, graph->mask_size); data/uftrace-0.9.4/cmds/tui.c:1035: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 footer[COLS + 1]; data/uftrace-0.9.4/cmds/tui.c:1038:2: [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(footer, msg, COLS < msg_len ? COLS : msg_len); data/uftrace-0.9.4/cmds/tui.c:1050: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[COLS + 1]; data/uftrace-0.9.4/cmds/tui.c:1199: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[32]; data/uftrace-0.9.4/cmds/tui.c:1373: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[COLS + 1]; data/uftrace-0.9.4/cmds/tui.c:1536: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/uftrace-0.9.4/cmds/tui.c:1615: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/uftrace-0.9.4/cmds/tui.c:1660: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[1024]; data/uftrace-0.9.4/cmds/tui.c:2080: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[512]; data/uftrace-0.9.4/cmds/tui.c:2279: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[16]; data/uftrace-0.9.4/libmcount/dynamic.c:110: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(orig->orig, (void *)info->addr, info->orig_size); data/uftrace-0.9.4/libmcount/dynamic.c:113:2: [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(orig->insn, info->insns, info->copy_size); data/uftrace-0.9.4/libmcount/dynamic.c:114:2: [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(orig->insn + info->copy_size, jmp_insn, jmp_size); data/uftrace-0.9.4/libmcount/event.c:196: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(filename, "w"); data/uftrace-0.9.4/libmcount/internal.h:353: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. unsigned char v[16]; data/uftrace-0.9.4/libmcount/internal.h:445:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char insns[64]; data/uftrace-0.9.4/libmcount/mcount.c:157:2: [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(&item->tr, tr, sizeof(*tr)); data/uftrace-0.9.4/libmcount/mcount.c:235: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 num_spec_str[16]; data/uftrace-0.9.4/libmcount/mcount.c:294:4: [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(num_spec_str, "SIGRTMIN"); data/uftrace-0.9.4/libmcount/mcount.c:305:4: [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(num_spec_str, "SIGRTMAX"); data/uftrace-0.9.4/libmcount/mcount.c:1740: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). pfd = open(channel, O_WRONLY); data/uftrace-0.9.4/libmcount/misc.c:20: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[8]; data/uftrace-0.9.4/libmcount/misc.c:29: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(filename, O_WRONLY | O_APPEND); data/uftrace-0.9.4/libmcount/misc.c:44: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(filename, O_WRONLY | O_APPEND); data/uftrace-0.9.4/libmcount/misc.c:60: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. static char session[SESSION_ID_LEN + 1]; data/uftrace-0.9.4/libmcount/misc.c:65: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("/dev/urandom", O_RDONLY); data/uftrace-0.9.4/libmcount/misc.c:251: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 dbg_str[DBG_DOMAIN_MAX * 2 + 1]; data/uftrace-0.9.4/libmcount/misc.c:273:2: [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(dbg_str, "M2"); data/uftrace-0.9.4/libmcount/record.c:66: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[128]; data/uftrace-0.9.4/libmcount/record.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 buf[128]; data/uftrace-0.9.4/libmcount/record.c:187: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/uftrace-0.9.4/libmcount/record.c:308: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[PATH_MAX]; data/uftrace-0.9.4/libmcount/record.c:310: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("/proc/self/maps", "r"); data/uftrace-0.9.4/libmcount/record.c:446: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[32]; data/uftrace-0.9.4/libmcount/record.c:477:11: [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. const char null_str[4] = { 'N', 'U', 'L', 'L' }; data/uftrace-0.9.4/libmcount/record.c:550: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("/proc/self/statm", "r"); data/uftrace-0.9.4/libmcount/record.c:871: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(ptr + 2, event->data, data_size); data/uftrace-0.9.4/libmcount/record.c:1100: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[PATH_MAX]; data/uftrace-0.9.4/libmcount/record.c:1104: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). ifp = fopen("/proc/self/maps", "r"); data/uftrace-0.9.4/libmcount/record.c:1110: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). ofp = fopen(buf, "w"); data/uftrace-0.9.4/libmcount/record.c:1118: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 prot[5]; data/uftrace-0.9.4/libmcount/record.c:1123: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 path[PATH_MAX]; data/uftrace-0.9.4/libmcount/wrap.c:73: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[PATH_MAX]; data/uftrace-0.9.4/libtraceevent/event-parse.c:864: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[BUFSIZ]; data/uftrace-0.9.4/libtraceevent/event-parse.c:1915:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(left->atom.atom, " *"); data/uftrace-0.9.4/libtraceevent/event-parse.c:2039: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(ref, type, len); data/uftrace-0.9.4/libtraceevent/event-parse.c:2286: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. static char buf[20]; data/uftrace-0.9.4/libtraceevent/event-parse.c:2296: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(buf, "%lld", val); data/uftrace-0.9.4/libtraceevent/event-parse.c:3606: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[3]; data/uftrace-0.9.4/libtraceevent/event-parse.c:3637: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(str + i, buf, 2); data/uftrace-0.9.4/libtraceevent/event-parse.c:3710: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(str, data + field->offset, len); data/uftrace-0.9.4/libtraceevent/event-parse.c:4246: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 format[32]; data/uftrace-0.9.4/libtraceevent/event-parse.c:4365:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(format, saveptr, len); data/uftrace-0.9.4/libtraceevent/event-parse.c:4392:7: [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(format, "0x%llx"); data/uftrace-0.9.4/libtraceevent/event-parse.c:4448:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(format, saveptr, len); data/uftrace-0.9.4/libtraceevent/event-parse.c:4789: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(events, pevent->events, sizeof(*events) * pevent->nr_events); data/uftrace-0.9.4/libtraceevent/event-parse.c:5007:12: [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). *offset = atoi(token); data/uftrace-0.9.4/libtraceevent/event-parse.c:5017:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *size = atoi(token); data/uftrace-0.9.4/libtraceevent/event-parse.c:5359:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, msg, min(buflen - 1, len)); data/uftrace-0.9.4/libtraceevent/event-parse.c:5571: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[128]; data/uftrace-0.9.4/libtraceevent/event-parse.c:5584: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(tmp, "0x%08llx", val); data/uftrace-0.9.4/libtraceevent/event-parse.h:577:2: [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(&__val, (ptr), sizeof(unsigned long long)); \ data/uftrace-0.9.4/libtraceevent/event-parse.h:586:2: [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(&val, str, 4); data/uftrace-0.9.4/libtraceevent/event-parse.h:892: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 error_buffer[PEVENT_FILTER_ERROR_BUFSZ]; data/uftrace-0.9.4/libtraceevent/parse-filter.c:93: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(*tok, "%c%c", *token, '~'); data/uftrace-0.9.4/libtraceevent/parse-filter.c:1303: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(this_event, filter_str, len); data/uftrace-0.9.4/libtraceevent/parse-filter.c:1870: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 hex[64]; data/uftrace-0.9.4/libtraceevent/parse-filter.c:1882:4: [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(arg->str.buffer, val, arg->str.field->size); data/uftrace-0.9.4/libtraceevent/trace-seq.c:206:2: [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(s->buffer + s->len, str, len); data/uftrace-0.9.4/misc/demangler.c:103: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[4096]; data/uftrace-0.9.4/misc/prototypes.h:14:5: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int atoi(const char *str); data/uftrace-0.9.4/misc/prototypes.h:15:6: [2] (integer) atol: 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). long atol(const char *str); data/uftrace-0.9.4/misc/prototypes.h:144:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. void memcpy(void *dest, const void *src, size_t n); data/uftrace-0.9.4/misc/prototypes.h:209:5: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int open(const char* pathname, enum uft_open_flag flags); data/uftrace-0.9.4/misc/prototypes.h:242: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). FILE *fopen(const char *path, const char *mode); data/uftrace-0.9.4/misc/prototypes.h:287:7: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. pid_t vfork(void); data/uftrace-0.9.4/misc/symbols.c:98: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(fname, "r"); data/uftrace-0.9.4/misc/symbols.c:224: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[4096]; data/uftrace-0.9.4/tests/arch/arm/thumb.c:5: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[128]; data/uftrace-0.9.4/tests/s-abc.c:31:9: [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). ret = atoi(argv[1]); data/uftrace-0.9.4/tests/s-alloca.c:23:7: [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). c = atoi(argv[1]); data/uftrace-0.9.4/tests/s-arg.c:92:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-autoargs.c:10: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[1024]; data/uftrace-0.9.4/tests/s-backtrace.cpp:31:9: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-daemon.c:31:9: [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). ret = atoi(argv[1]); data/uftrace-0.9.4/tests/s-diff.c:23:14: [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). do_sleep = atoi(argv[1]); data/uftrace-0.9.4/tests/s-dlopen.c:12:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-dlopen2.cpp:19:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-dynamic.c:31:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-exp-mixed.c:23: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. static char buf[32]; data/uftrace-0.9.4/tests/s-exp-str.c:24:1: [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 a[32]; data/uftrace-0.9.4/tests/s-exp-str.c:25:1: [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 b[32]; data/uftrace-0.9.4/tests/s-fibonacci.c:16:9: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-fork.c:32:9: [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). ret = atoi(argv[1]); data/uftrace-0.9.4/tests/s-fork2.c:15: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). close(open("/dev/null", O_RDONLY)); data/uftrace-0.9.4/tests/s-libmain.c:21:9: [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). ret = atoi(argv[1]); data/uftrace-0.9.4/tests/s-malloc-fork.c:15:8: [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 buf[MALLOC_BUFSIZE]; data/uftrace-0.9.4/tests/s-malloc-hook.c:13:8: [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 buf[MALLOC_BUFSIZE]; data/uftrace-0.9.4/tests/s-malloc-tsd.c:17:8: [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 buf[MALLOC_BUFSIZE]; data/uftrace-0.9.4/tests/s-malloc.c:13: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. static char buf[MALLOC_BUFSIZE]; data/uftrace-0.9.4/tests/s-malloc.c:33: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(p, ptr, size); data/uftrace-0.9.4/tests/s-mmap.c:11: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/zero", O_RDONLY); data/uftrace-0.9.4/tests/s-mmap.c:25:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-nest-libcall.c:11:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-openclose.c:5: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). fclose(fopen("/dev/null", "r")); data/uftrace-0.9.4/tests/s-pltarg.c:10:9: [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). num = atoi(argv[1]); data/uftrace-0.9.4/tests/s-return.c:7: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[4096]; data/uftrace-0.9.4/tests/s-sdt.c:14:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-signal.c:32:9: [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). sig = atoi(argv[1]); data/uftrace-0.9.4/tests/s-signal2.c:44:9: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). max = atoi(argv[1]); data/uftrace-0.9.4/tests/s-thread.c:43:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-ucontext.c:25: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 stack[STACKSIZE]; data/uftrace-0.9.4/tests/s-ucontext.c:29:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-unroll.c:32:7: [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). n = atoi(argv[1]); data/uftrace-0.9.4/tests/s-unroll.c:34: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). n = strtol(argv[1], NULL, atoi(argv[2])); data/uftrace-0.9.4/tests/s-variadic.c:8: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/uftrace-0.9.4/tests/s-vforkexec.c:12:8: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. pid = vfork(); data/uftrace-0.9.4/uftrace.c:907: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(filename, "r"); data/uftrace-0.9.4/uftrace.c:984: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(opts->script_file, "r"); data/uftrace-0.9.4/uftrace.c:1054: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 opts_file[PATH_MAX]; data/uftrace-0.9.4/uftrace.c:1123:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). logfp = fopen(opts.logfile, "a"); data/uftrace-0.9.4/uftrace.c:1345: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(OPT_FILE, "w"); data/uftrace-0.9.4/uftrace.c:1405: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(OPT_FILE, "w"); data/uftrace-0.9.4/uftrace.c:1452: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(OPT_FILE, "w"); data/uftrace-0.9.4/uftrace.h:38: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 magic[UFTRACE_MAGIC_LEN]; data/uftrace-0.9.4/uftrace.h:99:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char build_id[20]; data/uftrace-0.9.4/uftrace.h:320: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 sid[SESSION_ID_LEN]; data/uftrace-0.9.4/uftrace.h:346: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[TASK_COMM_LEN]; data/uftrace-0.9.4/uftrace.h:399: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 sid[16]; data/uftrace-0.9.4/uftrace.h:408: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 sid[16]; data/uftrace-0.9.4/utils/auto-args.c:55:2: [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(new, entry, sizeof(*new)); data/uftrace-0.9.4/utils/auto-args.c:383:8: [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 enum_token[256]; data/uftrace-0.9.4/utils/data-file.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 pad[8]; data/uftrace-0.9.4/utils/data-file.c:42: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[1024]; data/uftrace-0.9.4/utils/data-file.c:49: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(buf, O_RDONLY); data/uftrace-0.9.4/utils/data-file.c:129: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(fname, "r"); data/uftrace-0.9.4/utils/data-file.c:241: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(fname, "r"); data/uftrace-0.9.4/utils/data-file.c:253: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 provider[512]; data/uftrace-0.9.4/utils/data-file.c:254: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 event[512]; data/uftrace-0.9.4/utils/data-file.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 ts[128]; data/uftrace-0.9.4/utils/data-file.c:291: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(fname, "a"); data/uftrace-0.9.4/utils/data-file.c:307: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 ts[128]; data/uftrace-0.9.4/utils/data-file.c:311: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(fname, "a"); data/uftrace-0.9.4/utils/data-file.c:328: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 ts[128]; data/uftrace-0.9.4/utils/data-file.c:332: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(fname, "a"); data/uftrace-0.9.4/utils/data-file.c:349: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 ts[128]; data/uftrace-0.9.4/utils/data-file.c:353: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(fname, "a"); data/uftrace-0.9.4/utils/data-file.c:417: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[PATH_MAX]; data/uftrace-0.9.4/utils/data-file.c:425: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(buf, "rb"); data/uftrace-0.9.4/utils/data-file.c:437: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("./info", "rb"); data/uftrace-0.9.4/utils/data-file.c:445: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(buf, "rb"); data/uftrace-0.9.4/utils/data-file.c:505: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[PATH_MAX]; data/uftrace-0.9.4/utils/debug.c:81: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[PATH_MAX]; data/uftrace-0.9.4/utils/debug.c:181: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[512]; data/uftrace-0.9.4/utils/demangle.c:71:8: [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. const char *debug[MAX_DEBUG_DEPTH]; data/uftrace-0.9.4/utils/demangle.c:74:8: [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 dd_expbuf[2]; data/uftrace-0.9.4/utils/demangle.c:184: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 op[2]; data/uftrace-0.9.4/utils/demangle.c:1482: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 buf[32]; data/uftrace-0.9.4/utils/dwarf.c:270: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(filename, O_RDONLY); data/uftrace-0.9.4/utils/dwarf.c:329: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 buf[256]; data/uftrace-0.9.4/utils/dwarf.c:595:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(spec, "/c"); data/uftrace-0.9.4/utils/dwarf.c:599:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(spec, "/s"); data/uftrace-0.9.4/utils/dwarf.c:609: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 sz[16]; data/uftrace-0.9.4/utils/dwarf.c:612:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(spec, "/f"); data/uftrace-0.9.4/utils/dwarf.c:617:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(spec, "/p"); data/uftrace-0.9.4/utils/dwarf.c:620:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(spec, "/e:"); data/uftrace-0.9.4/utils/dwarf.c:702: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/uftrace-0.9.4/utils/dwarf.c:742: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[256]; data/uftrace-0.9.4/utils/dwarf.c:770: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/uftrace-0.9.4/utils/dwarf.c:1211: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(tmp, "ax"); data/uftrace-0.9.4/utils/dwarf.c:1338: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(pathname, "r"); data/uftrace-0.9.4/utils/extern.c:40: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(filename, "r"); data/uftrace-0.9.4/utils/extern.c:63: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[EXTERN_DATA_MAX + 64]; data/uftrace-0.9.4/utils/filter.c:95: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[1024]; data/uftrace-0.9.4/utils/filter.c:329:2: [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(new, filter, sizeof(*new)); data/uftrace-0.9.4/utils/fstack.c:110: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). task->fp = fopen(filename, "rb"); data/uftrace-0.9.4/utils/fstack.c:339:26: [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. uftrace_setup_trigger((char *)fixup_syms[i], &s->symtabs, data/uftrace-0.9.4/utils/fstack.c:982:2: [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(&node->rstack, rstack, sizeof(*rstack)); data/uftrace-0.9.4/utils/fstack.c:984: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(&node->args, args, sizeof(*args)); data/uftrace-0.9.4/utils/fstack.c:986: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(node->args.data, args->data, args->len); data/uftrace-0.9.4/utils/fstack.c:1218:2: [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(task->args.data, buf, buflen); data/uftrace-0.9.4/utils/fstack.c:1638:2: [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(&task->ustack, curr, sizeof(*task->rstack)); data/uftrace-0.9.4/utils/fstack.c:1695:2: [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(&(*task)->estack, next, sizeof(*next)); data/uftrace-0.9.4/utils/fstack.c:2356: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(filename, "w"); data/uftrace-0.9.4/utils/fstack.h:176:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[EXTERN_DATA_MAX]; data/uftrace-0.9.4/utils/kernel.c:82: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(file, flags); data/uftrace-0.9.4/utils/kernel.c:168: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[16]; data/uftrace-0.9.4/utils/kernel.c:239: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/uftrace-0.9.4/utils/kernel.c:250: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/uftrace-0.9.4/utils/kernel.c:295: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[1024]; data/uftrace-0.9.4/utils/kernel.c:298: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(filename, "r"); data/uftrace-0.9.4/utils/kernel.c:400: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[1024]; data/uftrace-0.9.4/utils/kernel.c:403: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(filename, "r"); data/uftrace-0.9.4/utils/kernel.c:682: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[PATH_MAX]; data/uftrace-0.9.4/utils/kernel.c:696:23: [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). kernel->traces[i] = open(trace_file, O_RDONLY); data/uftrace-0.9.4/utils/kernel.c:712: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). kernel->fds[i] = open(buf, O_WRONLY | O_TRUNC | O_CREAT, 0600); data/uftrace-0.9.4/utils/kernel.c:751: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[PATH_MAX]; data/uftrace-0.9.4/utils/kernel.c:860: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[BUFSIZ]; data/uftrace-0.9.4/utils/kernel.c:863: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(filename, "r"); data/uftrace-0.9.4/utils/kernel.c:888: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(filename, O_RDONLY); data/uftrace-0.9.4/utils/kernel.c:901: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[PATH_MAX]; data/uftrace-0.9.4/utils/kernel.c:918: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[PATH_MAX]; data/uftrace-0.9.4/utils/kernel.c:1007: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(path, "w"); data/uftrace-0.9.4/utils/kernel.c:1040: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[PATH_MAX]; data/uftrace-0.9.4/utils/kernel.c:1049: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(TRACING_DIR"/events/header_page", O_RDONLY); data/uftrace-0.9.4/utils/kernel.c:1057: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(TRACING_DIR"/events/ftrace/funcgraph_entry/format", O_RDONLY); data/uftrace-0.9.4/utils/kernel.c:1065: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(TRACING_DIR"/events/ftrace/funcgraph_exit/format", O_RDONLY); data/uftrace-0.9.4/utils/kernel.c:1080: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[PATH_MAX]; data/uftrace-0.9.4/utils/kernel.c:1086: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(path, "r"); data/uftrace-0.9.4/utils/kernel.c:1091: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[128]; data/uftrace-0.9.4/utils/kernel.c:1095: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 val[32]; data/uftrace-0.9.4/utils/kernel.c:1198: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[PATH_MAX]; data/uftrace-0.9.4/utils/kernel.c:1248: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). kernel->fds[i] = open(buf, O_RDONLY); data/uftrace-0.9.4/utils/kernel.c:1524:2: [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(&kernel->rstacks[cpu], &kernel->trace_rec, sizeof(kernel->trace_rec)); data/uftrace-0.9.4/utils/kernel.c:1717:2: [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(&kernel->rstacks[cpu], curr, sizeof(*curr)); data/uftrace-0.9.4/utils/kernel.c:1812:2: [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(&(*taskp)->kstack, first_rstack, sizeof(*first_rstack)); data/uftrace-0.9.4/utils/kernel.c:2058: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(filename, "w"); data/uftrace-0.9.4/utils/kernel.c:2080: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(filename, "w"); data/uftrace-0.9.4/utils/perf.c:69: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[PATH_MAX]; data/uftrace-0.9.4/utils/perf.c:112:19: [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). perf->fp[cpu] = fopen(filename, "w"); data/uftrace-0.9.4/utils/perf.c:266: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). perf[i].fp = fopen(globbuf.gl_pathv[i], "r"); data/uftrace-0.9.4/utils/perf.h:43: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[COMM_LEN]; data/uftrace-0.9.4/utils/perf.h:69: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[COMM_LEN]; data/uftrace-0.9.4/utils/report.c:483: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(node, iter, sizeof(*node)); data/uftrace-0.9.4/utils/report.c:723:8: [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. const char *test_name[TEST_NODES] = { "abc", "foo", "bar" }; data/uftrace-0.9.4/utils/report.c:724:8: [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. const char *name_sort[TEST_NODES] = { "abc", "bar", "foo" }; data/uftrace-0.9.4/utils/script-luajit.c:98: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 ch_str[2]; data/uftrace-0.9.4/utils/script-luajit.c:116:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/utils/script-luajit.c:145:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/utils/script-luajit.c:171:4: [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(&slen, data, 2); data/uftrace-0.9.4/utils/script-luajit.c:176:4: [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(str, data + 2, slen); data/uftrace-0.9.4/utils/script-luajit.c:181:5: [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(str, "NULL"); data/uftrace-0.9.4/utils/script-luajit.c:192:4: [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(ch_str, data, 1); data/uftrace-0.9.4/utils/script-python.c:194: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 py_sysdir[PATH_MAX]; data/uftrace-0.9.4/utils/script-python.c:391: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 ch_str[2]; data/uftrace-0.9.4/utils/script-python.c:409:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/utils/script-python.c:431:4: [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(val.v, data, spec->size); data/uftrace-0.9.4/utils/script-python.c:455:4: [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(&slen, data, 2); data/uftrace-0.9.4/utils/script-python.c:460:4: [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(str, data + 2, slen); data/uftrace-0.9.4/utils/script-python.c:465:5: [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(str, "NULL"); data/uftrace-0.9.4/utils/script-python.c:474:4: [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(ch_str, data, 1); data/uftrace-0.9.4/utils/script.h:57:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char v[16]; data/uftrace-0.9.4/utils/session.c:31: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[PATH_MAX]; data/uftrace-0.9.4/utils/session.c:37: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(buf, "rb"); data/uftrace-0.9.4/utils/session.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 prot[5]; data/uftrace-0.9.4/utils/session.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 path[PATH_MAX]; data/uftrace-0.9.4/utils/session.c:75: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(map->prot, prot, 4); data/uftrace-0.9.4/utils/session.c:76: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(map->libname, path, namelen); data/uftrace-0.9.4/utils/session.c:160:2: [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(s->exename, exename, s->namelen); data/uftrace-0.9.4/utils/session.c:964: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("sid-test.map", "w"); data/uftrace-0.9.4/utils/session.c:969: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("unittest.sym", "w"); data/uftrace-0.9.4/utils/session.c:1013: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("sid-test.map", "w"); data/uftrace-0.9.4/utils/session.c:1018: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("libuftrace-test.so.0.sym", "w"); data/uftrace-0.9.4/utils/symbol-libelf.c:16: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). elf->fd = open(filename, O_RDONLY); data/uftrace-0.9.4/utils/symbol-libelf.c:69:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, iter->data->d_buf + offset, len); data/uftrace-0.9.4/utils/symbol-rawelf.c:88: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). elf->fd = open(filename, O_RDONLY); data/uftrace-0.9.4/utils/symbol-rawelf.c:154:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, &iter->data[offset], len); data/uftrace-0.9.4/utils/symbol-rawelf.h:75: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(&(iter)->sym, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:88:8: [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(&(iter)->phdr, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:98:8: [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(&(iter)->shdr, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:113:8: [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(&(iter)->dyn, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:127:8: [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(&(iter)->sym, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:141:8: [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(&(iter)->sym, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:154:8: [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(&(iter)->rel, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:167:8: [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(&(iter)->rela, \ data/uftrace-0.9.4/utils/symbol-rawelf.h:181:8: [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(&(iter)->nhdr, (iter)->data + (iter)->i, \ data/uftrace-0.9.4/utils/symbol.c:145: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 magic[2]; data/uftrace-0.9.4/utils/symbol.c:149: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(filename, O_RDONLY); data/uftrace-0.9.4/utils/symbol.c:519:4: [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(&dyn_iter, &sec_iter, sizeof(sec_iter)); data/uftrace-0.9.4/utils/symbol.c:525:4: [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(&rel_iter, &sec_iter, sizeof(sec_iter)); data/uftrace-0.9.4/utils/symbol.c:529:4: [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(&rel_iter, &sec_iter, sizeof(sec_iter)); data/uftrace-0.9.4/utils/symbol.c:661: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(&syms[0], left->sym, left->nr_sym * sizeof(*syms)); data/uftrace-0.9.4/utils/symbol.c:662: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(&syms[left->nr_sym], right->sym, right->nr_sym * sizeof(*syms)); data/uftrace-0.9.4/utils/symbol.c:665: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(&syms[0], right->sym, right->nr_sym * sizeof(*syms)); data/uftrace-0.9.4/utils/symbol.c:666: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(&syms[right->nr_sym], left->sym, left->nr_sym * sizeof(*syms)); data/uftrace-0.9.4/utils/symbol.c:865: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(symfile, "r"); data/uftrace-0.9.4/utils/symbol.c:1154: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(symfile, "wx"); data/uftrace-0.9.4/utils/symbol.c:1225: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[PATH_MAX]; data/uftrace-0.9.4/utils/symbol.c:1231: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). ifp = fopen("/proc/kallsyms", "r"); data/uftrace-0.9.4/utils/symbol.c:1232: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). ofp = fopen(symfile, "w"); data/uftrace-0.9.4/utils/symbol.h:76: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 prot[4]; data/uftrace-0.9.4/utils/utils.c:144: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[PATH_MAX]; data/uftrace-0.9.4/utils/utils.c:189: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 sig[UFTRACE_MAGIC_LEN] = {0,}; data/uftrace-0.9.4/utils/utils.c:193: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(info_path, O_RDONLY); data/uftrace-0.9.4/utils/utils.c:248: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 opts_filename[PATH_MAX]; data/uftrace-0.9.4/utils/utils.c:253: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(opts_filename, "w"); data/uftrace-0.9.4/utils/utils.c:306: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[PATH_MAX]; data/uftrace-0.9.4/utils/utils.c:346: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. static char exename[PATH_MAX]; data/uftrace-0.9.4/cmds/dump.c:336:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, ptr + 2, size); data/uftrace-0.9.4/cmds/dump.c:433:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, ptr + 2, size); data/uftrace-0.9.4/cmds/dump.c:995: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). buf[strlen(buf) - 1] = '\0'; data/uftrace-0.9.4/cmds/dump.c:1096: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). len += strlen(parent->name) + 1; data/uftrace-0.9.4/cmds/dump.c:1481:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(perf.u.comm.comm, task->args.data, TASK_COMM_LAST); data/uftrace-0.9.4/cmds/graph.c:730: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). size_t old_len = opts->trigger ? strlen(opts->trigger) : 0; data/uftrace-0.9.4/cmds/graph.c:731:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t new_len = strlen(func) + 32; data/uftrace-0.9.4/cmds/info.c:48: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 len = strlen(dst); data/uftrace-0.9.4/cmds/info.c:836:8: [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(&buf[13]); data/uftrace-0.9.4/cmds/live.c:85: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). size_t len = strlen(libpath) + strlen(old_preload) + 2; data/uftrace-0.9.4/cmds/live.c:85:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(libpath) + strlen(old_preload) + 2; data/uftrace-0.9.4/cmds/live.c:109:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(022); data/uftrace-0.9.4/cmds/record.c:142:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(lib, libmcount, PATH_MAX); data/uftrace-0.9.4/cmds/record.c:344: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). size_t len = strlen(libpath) + strlen(old_preload) + 2; data/uftrace-0.9.4/cmds/record.c:344:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(libpath) + strlen(old_preload) + 2; data/uftrace-0.9.4/cmds/record.c:425:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(efd, elf_ident, sizeof(elf_ident)) < 0) data/uftrace-0.9.4/cmds/record.c:428:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(hdr.magic, UFTRACE_MAGIC_STR, UFTRACE_MAGIC_LEN); data/uftrace-0.9.4/cmds/record.c:690:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(thread_ctl[0], &dummy, sizeof(dummy)) < 0) { data/uftrace-0.9.4/cmds/record.c:1032:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, line, sizeof(line) - 1); data/uftrace-0.9.4/cmds/record.c:1286: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 len = strlen(de->d_name); data/uftrace-0.9.4/cmds/record.c:1311: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 len = strlen(de->d_name); data/uftrace-0.9.4/cmds/record.c:1335: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 len = strlen(de->d_name); data/uftrace-0.9.4/cmds/record.c:1571:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, elf_ident, sizeof(elf_ident)) < 0) data/uftrace-0.9.4/cmds/record.c:1594:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &e_type, sizeof(e_type)) < 0) data/uftrace-0.9.4/cmds/record.c:1600:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &e_machine, sizeof(e_machine)) < 0) data/uftrace-0.9.4/cmds/record.c:1858:3: [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(1000); data/uftrace-0.9.4/cmds/record.c:2119:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(ready, &dummy, sizeof(dummy)) != (ssize_t)sizeof(dummy)) data/uftrace-0.9.4/cmds/recv.c:107: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). ssize_t len = strlen(name); data/uftrace-0.9.4/cmds/recv.c:187:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int32_t namelen = strlen(filename); data/uftrace-0.9.4/cmds/recv.c:642:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int nr = read(sigfd, &si, sizeof si); data/uftrace-0.9.4/cmds/replay.c:731:8: [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(estr) >= len) data/uftrace-0.9.4/cmds/replay.c:801: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). if (symname[strlen(symname) - 1] != ')' || rstack->more) data/uftrace-0.9.4/cmds/tui.c:994:8: [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). w += strlen(FIELD_SEP); data/uftrace-0.9.4/cmds/tui.c:998: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). w += strlen(" FUNCTION"); data/uftrace-0.9.4/cmds/tui.c:1034: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). int msg_len = strlen(msg); data/uftrace-0.9.4/cmds/tui.c:1495: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). str[strlen(str) - 1] = '\0'; data/uftrace-0.9.4/cmds/tui.c:2621: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). mvprintw(row / 2, (col - strlen(tuimsg)) / 2, "%s", tuimsg); data/uftrace-0.9.4/libmcount/dynamic.c:286:36: [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(libname, pl->module, strlen(pl->module))) data/uftrace-0.9.4/libmcount/event.c:102:21: [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). event = vendor + strlen(vendor) + 1; data/uftrace-0.9.4/libmcount/event.c:103:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). args = event + strlen(event) + 1; data/uftrace-0.9.4/libmcount/mcount.c:519:14: [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). .namelen = strlen(mcount_exename), data/uftrace-0.9.4/libmcount/mcount.c:1018:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). save_trigger_read(mtdp, rstack, tr->read, false); data/uftrace-0.9.4/libmcount/mcount.c:1103:39: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). save_trigger_read(mtdp, rstack, tr.read, true); data/uftrace-0.9.4/libmcount/misc.c:34:8: [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(buf); data/uftrace-0.9.4/libmcount/misc.c:49:8: [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(buf); data/uftrace-0.9.4/libmcount/misc.c:67:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &session_id, sizeof(session_id)) != 8) data/uftrace-0.9.4/libmcount/misc.c:114:8: [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(dbg_domain_str); data/uftrace-0.9.4/libmcount/misc.c:254: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). TEST_EQ(DBG_DOMAIN_MAX, (int)strlen(DBG_DOMAIN_STR)); data/uftrace-0.9.4/libmcount/pmu.c:83:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, len) != len) data/uftrace-0.9.4/libmcount/record.c:87:51: [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). uftrace_send_message(UFTRACE_MSG_REC_START, buf, strlen(buf)); data/uftrace-0.9.4/libmcount/record.c:166:51: [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). uftrace_send_message(UFTRACE_MSG_REC_START, buf, strlen(buf)); data/uftrace-0.9.4/libmcount/record.c:192:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). uftrace_send_message(UFTRACE_MSG_REC_END, buf, strlen(buf)); data/uftrace-0.9.4/libmcount/record.c:1168:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). namelen = ALIGN(strlen(path) + 1, 4); data/uftrace-0.9.4/libmcount/record.c:1177: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). map->libname[strlen(path)] = '\0'; data/uftrace-0.9.4/libmcount/wrap.c:44:14: [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). .namelen = strlen(libname), data/uftrace-0.9.4/libtraceevent/event-parse.c:638:21: [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 = item->printk + strlen(item->printk) - 1; data/uftrace-0.9.4/libtraceevent/event-parse.c:1040: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). init_input_buf(str, strlen(str)); data/uftrace-0.9.4/libtraceevent/event-parse.c:1353: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). strlen(field->type) + data/uftrace-0.9.4/libtraceevent/event-parse.c:1354: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). strlen(last_token) + 2); data/uftrace-0.9.4/libtraceevent/event-parse.c:1360:6: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(field->type, " "); data/uftrace-0.9.4/libtraceevent/event-parse.c:1405:14: [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(brackets) + data/uftrace-0.9.4/libtraceevent/event-parse.c:1406:14: [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(token) + len); data/uftrace-0.9.4/libtraceevent/event-parse.c:1413:6: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(brackets, " "); data/uftrace-0.9.4/libtraceevent/event-parse.c:1427:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). new_brackets = realloc(brackets, strlen(brackets) + 2); data/uftrace-0.9.4/libtraceevent/event-parse.c:1433:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(brackets, "]"); data/uftrace-0.9.4/libtraceevent/event-parse.c:1445:10: [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(field->type) + data/uftrace-0.9.4/libtraceevent/event-parse.c:1446:10: [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(field->name) + data/uftrace-0.9.4/libtraceevent/event-parse.c:1447:10: [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(brackets) + 2); data/uftrace-0.9.4/libtraceevent/event-parse.c:1453:5: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(field->type, " "); data/uftrace-0.9.4/libtraceevent/event-parse.c:1463:10: [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(field->type) + data/uftrace-0.9.4/libtraceevent/event-parse.c:1464:10: [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(brackets) + 1); data/uftrace-0.9.4/libtraceevent/event-parse.c:1910:10: [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(left->atom.atom) + 3); data/uftrace-0.9.4/libtraceevent/event-parse.c:2025:8: [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(type); data/uftrace-0.9.4/libtraceevent/event-parse.c:2889: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). strlen(atom) + strlen(token) + 2); data/uftrace-0.9.4/libtraceevent/event-parse.c:2889: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). strlen(atom) + strlen(token) + 2); data/uftrace-0.9.4/libtraceevent/event-parse.c:2897:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(atom, " "); data/uftrace-0.9.4/libtraceevent/event-parse.c:4065: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). bptr += strlen(bptr) + 1; data/uftrace-0.9.4/libtraceevent/event-parse.c:4390: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). memmove(p+1, p, strlen(p)+1); data/uftrace-0.9.4/libtraceevent/event-parse.c:4719:8: [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(event->name); data/uftrace-0.9.4/libtraceevent/event-parse.c:5358: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). size_t len = strlen(msg); data/uftrace-0.9.4/libtraceevent/event-plugin.c:77:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name = malloc(strlen(op->name) + strlen(alias) + 2); data/uftrace-0.9.4/libtraceevent/event-plugin.c:77:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name = malloc(strlen(op->name) + strlen(alias) + 2); data/uftrace-0.9.4/libtraceevent/event-plugin.c:246:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). plugin = malloc(strlen(path) + strlen(file) + 2); data/uftrace-0.9.4/libtraceevent/event-plugin.c:246:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). plugin = malloc(strlen(path) + strlen(file) + 2); data/uftrace-0.9.4/libtraceevent/event-plugin.c:253:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(plugin, "/"); data/uftrace-0.9.4/libtraceevent/event-plugin.c:326: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). if (strcmp(name + (strlen(name) - strlen(suffix)), suffix) != 0) data/uftrace-0.9.4/libtraceevent/event-plugin.c:326:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strcmp(name + (strlen(name) - strlen(suffix)), suffix) != 0) data/uftrace-0.9.4/libtraceevent/event-plugin.c:376: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). path = malloc(strlen(home) + strlen(LOCAL_PLUGIN_DIR) + 2); data/uftrace-0.9.4/libtraceevent/event-plugin.c:376: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). path = malloc(strlen(home) + strlen(LOCAL_PLUGIN_DIR) + 2); data/uftrace-0.9.4/libtraceevent/event-plugin.c:383:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(path, "/"); data/uftrace-0.9.4/libtraceevent/event-utils.h:56: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). string = ret + strlen(ret) - 1; data/uftrace-0.9.4/libtraceevent/parse-filter.c:51: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). len = input ? strlen(input) : 0; data/uftrace-0.9.4/libtraceevent/parse-filter.c:285: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). reg = malloc(strlen(event_name) + 3); data/uftrace-0.9.4/libtraceevent/parse-filter.c:298: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). reg = malloc(strlen(sys_name) + 3); data/uftrace-0.9.4/libtraceevent/parse-filter.c:499:8: [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(arg->value.str) == 1 && data/uftrace-0.9.4/libtraceevent/parse-filter.c:1194:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). pevent_buffer_init(filter_str, strlen(filter_str)); data/uftrace-0.9.4/libtraceevent/parse-filter.c:1285: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(filter_str); data/uftrace-0.9.4/libtraceevent/parse-filter.c:1295:10: [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(filter_str); data/uftrace-0.9.4/libtraceevent/parse-filter.c:1381: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). if (strlen(filter->error_buffer) > 0) { data/uftrace-0.9.4/libtraceevent/trace-seq.c:199:8: [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(str); data/uftrace-0.9.4/misc/prototypes.h:101:7: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. void *memalign(size_t alignment, size_t size); data/uftrace-0.9.4/misc/prototypes.h:114:7: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. char* strncat(char *dest, const char *src, size_t n); data/uftrace-0.9.4/misc/prototypes.h:116:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). void strncpy(void* dest, const char* src, size_t n); data/uftrace-0.9.4/misc/prototypes.h:117:8: [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 strlen(const char *s); data/uftrace-0.9.4/misc/prototypes.h:171:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char fgetc(FILE *stream); data/uftrace-0.9.4/misc/prototypes.h:173:6: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char getc(FILE *stream); data/uftrace-0.9.4/misc/prototypes.h:174:6: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char getchar(void); data/uftrace-0.9.4/misc/prototypes.h:251:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read(int fd, void *buf, size_t count); data/uftrace-0.9.4/misc/prototypes.h:501:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). void umask(enum uft_mode mask); data/uftrace-0.9.4/misc/symbols.c:135:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). smsg.namelen = strlen(exename); data/uftrace-0.9.4/misc/symbols.c:158:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dlop.namelen = strlen(exename); data/uftrace-0.9.4/tests/s-alloca.c:9:2: [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(ptr, "hello world\n", c); data/uftrace-0.9.4/tests/s-autoargs.c:11: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 len = strlen(msg); data/uftrace-0.9.4/tests/s-diff.c:7:3: [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(100); data/uftrace-0.9.4/tests/s-diff.c:13:3: [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(1000); data/uftrace-0.9.4/tests/s-diff.c:26:3: [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(10); data/uftrace-0.9.4/tests/s-sleep.c:16:2: [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(2000); data/uftrace-0.9.4/tests/s-sleep2.c:6:2: [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(3000); data/uftrace-0.9.4/tests/s-sleep2.c:11:2: [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(5000); data/uftrace-0.9.4/tests/s-sleep2.c:17:2: [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(1000); data/uftrace-0.9.4/tests/s-sort.c:22:2: [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(10000); data/uftrace-0.9.4/uftrace.c:347:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (isalpha(str[strlen(str) - 1])) data/uftrace-0.9.4/uftrace.c:390: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 len = strlen(path); data/uftrace-0.9.4/uftrace.c:996: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). comment_len = strlen(comment); data/uftrace-0.9.4/uftrace.c:1008:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp(pos, optname, strlen(optname))) data/uftrace-0.9.4/uftrace.c:1347:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fwrite(opt_file, strlen(opt_file), 1, fp); data/uftrace-0.9.4/uftrace.c:1407:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fwrite(opt_file, strlen(opt_file), 1, fp); data/uftrace-0.9.4/uftrace.c:1454:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fwrite(opt_file, strlen(opt_file), 1, fp); data/uftrace-0.9.4/uftrace.h:502:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). struct list_head read; data/uftrace-0.9.4/utils/auto-args.c:419: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(tok); data/uftrace-0.9.4/utils/auto-args.c:424:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(enum_token, tok, len); data/uftrace-0.9.4/utils/data-file.c:173:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). smsg.namelen = strlen(exename); data/uftrace-0.9.4/utils/data-file.c:202:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dlop.namelen = strlen(exename); data/uftrace-0.9.4/utils/debug.c:60: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 len = strlen(code); data/uftrace-0.9.4/utils/demangle.c:322:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&dd->new[dd->newpos], str, size); data/uftrace-0.9.4/utils/demangle.c:331: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). return dd_append_len(dd, str, strlen(str)); data/uftrace-0.9.4/utils/demangle.c:786:34: [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(unary_ops[i], exp, strlen(unary_ops[i]))) data/uftrace-0.9.4/utils/demangle.c:788:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dd_consume_n(dd, strlen(unary_ops[i])); data/uftrace-0.9.4/utils/demangle.c:1324:8: [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(pos); data/uftrace-0.9.4/utils/demangle.c:1430: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). strlen(rust_mappings[i].code))) data/uftrace-0.9.4/utils/demangle.c:1434: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). num += strlen(rust_mappings[i].code) + 2; data/uftrace-0.9.4/utils/demangle.c:1670:10: [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(str), data/uftrace-0.9.4/utils/dwarf.c:1361:8: [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). line[strlen(line) - 1] = '\0'; data/uftrace-0.9.4/utils/extern.c:93:8: [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(pos); data/uftrace-0.9.4/utils/filter.c:97:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). snprintf_trigger_read(buf, sizeof(buf), tr->read); data/uftrace-0.9.4/utils/filter.c:257:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). filter->trigger.read |= tr->read; data/uftrace-0.9.4/utils/filter.c:257:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). filter->trigger.read |= tr->read; data/uftrace-0.9.4/utils/filter.c:437:50: [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(basename(info->dlpi_name), soname, strlen(soname))) data/uftrace-0.9.4/utils/filter.c:725:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tr->read |= TRIGGER_READ_PROC_STATM; data/uftrace-0.9.4/utils/filter.c:727:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tr->read |= TRIGGER_READ_PAGE_FAULT; data/uftrace-0.9.4/utils/filter.c:729:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tr->read |= TRIGGER_READ_PMU_CYCLE; data/uftrace-0.9.4/utils/filter.c:731:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tr->read |= TRIGGER_READ_PMU_CACHE; data/uftrace-0.9.4/utils/filter.c:733:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tr->read |= TRIGGER_READ_PMU_BRANCH; data/uftrace-0.9.4/utils/filter.c:736:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (tr->read) data/uftrace-0.9.4/utils/filter.c:890:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncasecmp(pos, action->name, strlen(action->name))) data/uftrace-0.9.4/utils/filter.h:105:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). enum trigger_read_type read; data/uftrace-0.9.4/utils/fstack.c:962:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). INIT_LIST_HEAD(&list->read); data/uftrace-0.9.4/utils/fstack.c:989:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). list_add_tail(&node->list, &list->read); data/uftrace-0.9.4/utils/fstack.c:999:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_first_entry(&list->read, typeof(*node), list); data/uftrace-0.9.4/utils/fstack.c:1009:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_first_entry(&list->read, typeof(*node), list); data/uftrace-0.9.4/utils/fstack.c:1024:32: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_last_entry(&list->read, typeof(*node), list); data/uftrace-0.9.4/utils/fstack.c:1036:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!list_empty(&list->read)) { data/uftrace-0.9.4/utils/fstack.c:1039:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_first_entry(&list->read, typeof(*node), list); data/uftrace-0.9.4/utils/fstack.c:1569:52: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). list_for_each_entry_reverse(last, &rstack_list->read, list) { data/uftrace-0.9.4/utils/fstack.c:1573:42: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (list_no_entry(last, &rstack_list->read, list)) { data/uftrace-0.9.4/utils/fstack.c:1604:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). last = list_last_entry(&rstack_list->read, data/uftrace-0.9.4/utils/fstack.c:1971:47: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_first_entry(&task->rstack_list.read, data/uftrace-0.9.4/utils/fstack.c:1974:54: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_first_entry(&kernel->rstack_list[cpu].read, data/uftrace-0.9.4/utils/fstack.c:1977:46: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_first_entry(&task->event_list.read, data/uftrace-0.9.4/utils/fstack.c:2006:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(task->t->comm, task->args.data, TASK_COMM_LAST); data/uftrace-0.9.4/utils/fstack.c:2026:21: [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). task->args.len = strlen(extn->msg); data/uftrace-0.9.4/utils/fstack.c:2221: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). task->args.len = strlen(perf->u.comm.comm); data/uftrace-0.9.4/utils/kernel.c:94: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). ssize_t size = strlen(val); data/uftrace-0.9.4/utils/kernel.c:285:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). kfilter = xmalloc(sizeof(*kfilter) + strlen(name) + 1); data/uftrace-0.9.4/utils/kernel.c:311: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(buf); data/uftrace-0.9.4/utils/kernel.c:390:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). kevent = xmalloc(sizeof(*kevent) + strlen(name) + 1); data/uftrace-0.9.4/utils/kernel.c:573:41: [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). kfilter = xmalloc(sizeof(*kfilter) + strlen(name) + 1); data/uftrace-0.9.4/utils/kernel.c:758:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(kernel->traces[cpu], buf, sizeof(buf)); data/uftrace-0.9.4/utils/kernel.c:892:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, buf, len); data/uftrace-0.9.4/utils/kernel.c:1053:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, buf, sizeof(buf)); data/uftrace-0.9.4/utils/kernel.c:1061:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, buf, sizeof(buf)); data/uftrace-0.9.4/utils/kernel.c:1069:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, buf, sizeof(buf)); data/uftrace-0.9.4/utils/kernel.c:1139:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). !strncmp(name + strlen(name) - 7, "/format", 7)) { data/uftrace-0.9.4/utils/kernel.c:1652:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). last = list_last_entry(&rstack_list->read, data/uftrace-0.9.4/utils/kernel.c:1802:60: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). node = list_first_entry(&kernel->rstack_list[first_cpu].read, data/uftrace-0.9.4/utils/kernel.c:2065: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). fwrite(test_kernel_header, 1, strlen(test_kernel_header), fp); data/uftrace-0.9.4/utils/kernel.c:2067: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). fwrite(test_kernel_event, 1, strlen(test_kernel_event), fp); data/uftrace-0.9.4/utils/perf.c:383:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(perf->u.comm.comm, u.c.comm, sizeof(perf->u.comm.comm)); data/uftrace-0.9.4/utils/perf.c:545:44: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). last = list_last_entry(&task->event_list.read, data/uftrace-0.9.4/utils/perf.c:581: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). args.len = strlen(perf->u.comm.comm) + 1; data/uftrace-0.9.4/utils/perf.c:590:45: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). last = list_last_entry(&task->event_list.read, data/uftrace-0.9.4/utils/perf.c:595:46: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (last->list.prev == &task->event_list.read) data/uftrace-0.9.4/utils/session.c:67:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). namelen = ALIGN(strlen(path) + 1, 4); data/uftrace-0.9.4/utils/session.c:77: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). map->libname[strlen(path)] = '\0'; data/uftrace-0.9.4/utils/session.c:186:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(t->comm, basename(exename), sizeof(t->comm)); data/uftrace-0.9.4/utils/session.c:493:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(t->comm, basename(s->exename), sizeof(t->comm)); data/uftrace-0.9.4/utils/symbol.c:153:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, magic, sizeof(magic)) < 0) data/uftrace-0.9.4/utils/symbol.c:160:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, shebang, 1024) < 0) { data/uftrace-0.9.4/utils/symbol.c:847:34: [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(mod_name, prefix, strlen(prefix))) data/uftrace-0.9.4/utils/symbol.c:923:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sym->name, name, 4); data/uftrace-0.9.4/utils/symbol.c:1046: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). m = xzalloc(sizeof(*m) + strlen(mod_name) + 1); data/uftrace-0.9.4/utils/symbol.c:1119:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp(libname, libstdcpp6, strlen(libstdcpp6))) { data/uftrace-0.9.4/utils/symbol.c:1595: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). map = xzalloc(sizeof(*map) + strlen(exename) + 1); data/uftrace-0.9.4/utils/symbol.c:1609: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). map->len = strlen(exename); data/uftrace-0.9.4/utils/utils.c:39:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, buf, size); data/uftrace-0.9.4/utils/utils.c:197:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, sig, UFTRACE_MAGIC_LEN) != UFTRACE_MAGIC_LEN) { data/uftrace-0.9.4/utils/utils.c:534:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t llen = left ? strlen(left) : 0; data/uftrace-0.9.4/utils/utils.c:535: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). size_t rlen = strlen(right); data/uftrace-0.9.4/utils/utils.c:536: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). size_t dlen = strlen(delim); data/uftrace-0.9.4/utils/utils.c:565: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 len = strlen(delim); ANALYSIS SUMMARY: Hits = 854 Lines analyzed = 62495 in approximately 1.37 seconds (45641 lines/second) Physical Source Lines of Code (SLOC) = 46909 Hits@level = [0] 256 [1] 210 [2] 441 [3] 75 [4] 123 [5] 5 Hits@level+ = [0+] 1110 [1+] 854 [2+] 644 [3+] 203 [4+] 128 [5+] 5 Hits/KSLOC@level+ = [0+] 23.6628 [1+] 18.2055 [2+] 13.7287 [3+] 4.32753 [4+] 2.72869 [5+] 0.106589 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.