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/babeltrace-1.5.8/include/babeltrace/context-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/compiler.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/send.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/uuid.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/mman.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/string.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/utc.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/glib.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/memstream.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/dirent.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/stdio.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/stdlib.h Examining data/babeltrace-1.5.8/include/babeltrace/compat/limits.h Examining data/babeltrace-1.5.8/include/babeltrace/babeltrace.h Examining data/babeltrace-1.5.8/include/babeltrace/mmap-align.h Examining data/babeltrace-1.5.8/include/babeltrace/ref.h Examining data/babeltrace-1.5.8/include/babeltrace/babeltrace-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/callbacks.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/metadata.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/callbacks-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/ctf-index.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/iterator.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/types.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/events.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf/events-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/align.h Examining data/babeltrace-1.5.8/include/babeltrace/prio_heap.h Examining data/babeltrace-1.5.8/include/babeltrace/trace-collection.h Examining data/babeltrace-1.5.8/include/babeltrace/dwarf.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/packet-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/fields-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/fields.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/validation-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/packet.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/field-types.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/trace.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/trace-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/event-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/event.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/stream-class-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/clock.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/resolve-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/utils.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/stream-class.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/field-path.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/field-types-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/stream-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/attributes-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/event-class.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/event-class-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/clock-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-ir/field-path-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/trace-debug-info.h Examining data/babeltrace-1.5.8/include/babeltrace/format.h Examining data/babeltrace-1.5.8/include/babeltrace/bitfield.h Examining data/babeltrace-1.5.8/include/babeltrace/iterator-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/context.h Examining data/babeltrace-1.5.8/include/babeltrace/crc32.h Examining data/babeltrace-1.5.8/include/babeltrace/list.h Examining data/babeltrace-1.5.8/include/babeltrace/debug-info.h Examining data/babeltrace-1.5.8/include/babeltrace/clock-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/clock.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/functor-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/event.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/stream-class.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/stream.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/event-types.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/writer.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/event-fields.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-writer/writer-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/error.h Examining data/babeltrace-1.5.8/include/babeltrace/types.h Examining data/babeltrace-1.5.8/include/babeltrace/object-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ref-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/ctf-text/types.h Examining data/babeltrace-1.5.8/include/babeltrace/trace-handle.h Examining data/babeltrace-1.5.8/include/babeltrace/utils.h Examining data/babeltrace-1.5.8/include/babeltrace/bin-info.h Examining data/babeltrace-1.5.8/include/babeltrace/iterator.h Examining data/babeltrace-1.5.8/include/babeltrace/endian.h Examining data/babeltrace-1.5.8/include/babeltrace/values.h Examining data/babeltrace-1.5.8/include/babeltrace/clock-types.h Examining data/babeltrace-1.5.8/include/babeltrace/trace-handle-internal.h Examining data/babeltrace-1.5.8/include/babeltrace/format-internal.h Examining data/babeltrace-1.5.8/formats/ctf/events-private.h Examining data/babeltrace-1.5.8/formats/ctf/writer/functor.c Examining data/babeltrace-1.5.8/formats/ctf/writer/writer.c Examining data/babeltrace-1.5.8/formats/ctf/iterator.c Examining data/babeltrace-1.5.8/formats/ctf/types/variant.c Examining data/babeltrace-1.5.8/formats/ctf/types/sequence.c Examining data/babeltrace-1.5.8/formats/ctf/types/integer.c Examining data/babeltrace-1.5.8/formats/ctf/types/float.c Examining data/babeltrace-1.5.8/formats/ctf/types/string.c Examining data/babeltrace-1.5.8/formats/ctf/types/struct.c Examining data/babeltrace-1.5.8/formats/ctf/types/array.c Examining data/babeltrace-1.5.8/formats/ctf/types/enum.c Examining data/babeltrace-1.5.8/formats/ctf/ctf.c Examining data/babeltrace-1.5.8/formats/ctf/callbacks.c Examining data/babeltrace-1.5.8/formats/ctf/ir/validation.c Examining data/babeltrace-1.5.8/formats/ctf/ir/resolve.c Examining data/babeltrace-1.5.8/formats/ctf/ir/trace.c Examining data/babeltrace-1.5.8/formats/ctf/ir/clock.c Examining data/babeltrace-1.5.8/formats/ctf/ir/values.c Examining data/babeltrace-1.5.8/formats/ctf/ir/field-path.c Examining data/babeltrace-1.5.8/formats/ctf/ir/event.c Examining data/babeltrace-1.5.8/formats/ctf/ir/attributes.c Examining data/babeltrace-1.5.8/formats/ctf/ir/utils.c Examining data/babeltrace-1.5.8/formats/ctf/ir/stream-class.c Examining data/babeltrace-1.5.8/formats/ctf/ir/event-class.c Examining data/babeltrace-1.5.8/formats/ctf/ir/ref.c Examining data/babeltrace-1.5.8/formats/ctf/ir/stream.c Examining data/babeltrace-1.5.8/formats/ctf/ir/packet.c Examining data/babeltrace-1.5.8/formats/ctf/ir/field-types.c Examining data/babeltrace-1.5.8/formats/ctf/ir/fields.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/objstack.h Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-ast.h Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-lexer.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-scanner.h Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/objstack.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.h Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-scanner-symbols.h Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser-test.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-parent-links.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-xml.c Examining data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-semantic-validator.c Examining data/babeltrace-1.5.8/formats/ctf/events.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/array.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/sequence.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/struct.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/string.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/integer.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/enum.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/variant.c Examining data/babeltrace-1.5.8/formats/ctf-text/types/float.c Examining data/babeltrace-1.5.8/formats/ctf-text/ctf-text.c Examining data/babeltrace-1.5.8/formats/lttng-live/lttng-viewer-abi.h Examining data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c Examining data/babeltrace-1.5.8/formats/lttng-live/lttng-live.h Examining data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c Examining data/babeltrace-1.5.8/formats/ctf-metadata/ctf-metadata.c Examining data/babeltrace-1.5.8/formats/bt-dummy/bt-dummy.c Examining data/babeltrace-1.5.8/types/sequence.c Examining data/babeltrace-1.5.8/types/types.c Examining data/babeltrace-1.5.8/types/array.c Examining data/babeltrace-1.5.8/types/struct.c Examining data/babeltrace-1.5.8/types/string.c Examining data/babeltrace-1.5.8/types/variant.c Examining data/babeltrace-1.5.8/types/float.c Examining data/babeltrace-1.5.8/types/enum.c Examining data/babeltrace-1.5.8/types/integer.c Examining data/babeltrace-1.5.8/converter/babeltrace-log.c Examining data/babeltrace-1.5.8/converter/babeltrace.c Examining data/babeltrace-1.5.8/tests/debug-info-data/tp.c Examining data/babeltrace-1.5.8/tests/debug-info-data/libhello.c Examining data/babeltrace-1.5.8/tests/debug-info-data/tp.h Examining data/babeltrace-1.5.8/tests/debug-info-data/libhello.h Examining data/babeltrace-1.5.8/tests/lib/common.c Examining data/babeltrace-1.5.8/tests/lib/test_bitfield.c Examining data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c Examining data/babeltrace-1.5.8/tests/lib/common.h Examining data/babeltrace-1.5.8/tests/lib/test_seek.c Examining data/babeltrace-1.5.8/tests/lib/test_bin_info.c Examining data/babeltrace-1.5.8/tests/lib/test_dwarf.c Examining data/babeltrace-1.5.8/tests/utils/tap/tap.c Examining data/babeltrace-1.5.8/tests/utils/tap/tap.h Examining data/babeltrace-1.5.8/lib/registry.c Examining data/babeltrace-1.5.8/lib/context.c Examining data/babeltrace-1.5.8/lib/trace-collection.c Examining data/babeltrace-1.5.8/lib/babeltrace.c Examining data/babeltrace-1.5.8/lib/dwarf.c Examining data/babeltrace-1.5.8/lib/error.c Examining data/babeltrace-1.5.8/lib/prio_heap/prio_heap.c Examining data/babeltrace-1.5.8/lib/crc32.c Examining data/babeltrace-1.5.8/lib/trace-handle.c Examining data/babeltrace-1.5.8/lib/utils.c Examining data/babeltrace-1.5.8/lib/iterator.c Examining data/babeltrace-1.5.8/lib/bin-info.c Examining data/babeltrace-1.5.8/lib/debug-info.c Examining data/babeltrace-1.5.8/bindings/python/babeltrace/python-complements.h Examining data/babeltrace-1.5.8/bindings/python/babeltrace/python-complements.c Examining data/babeltrace-1.5.8/compat/compat_uuid.c Examining data/babeltrace-1.5.8/compat/dummy.c FINAL RESULTS: data/babeltrace-1.5.8/converter/babeltrace-log.c:109:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, metadata_fmt, data/babeltrace-1.5.8/formats/ctf-text/ctf-text.c:311:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(pos->fp, "+%" PRIu64 ".%09" PRIu64, data/babeltrace-1.5.8/formats/ctf-text/types/integer.c:75:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(pos->fp, "%" PRIu64, data/babeltrace-1.5.8/formats/ctf-text/types/integer.c:78:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(pos->fp, "%" PRId64, data/babeltrace-1.5.8/formats/ctf-text/types/integer.c:119:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(pos->fp, "0%" PRIo64, v); data/babeltrace-1.5.8/formats/ctf-text/types/integer.c:139:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(pos->fp, "0x%" PRIX64, v); data/babeltrace-1.5.8/formats/ctf/ctf.c:379:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, "%02d:%02d:%02d.%09" PRIu64, data/babeltrace-1.5.8/formats/ctf/ctf.c:384:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, "%3" PRIu64 ".%09" PRIu64, data/babeltrace-1.5.8/formats/ctf/ctf.c:399:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, "%020" PRIu64, timestamp); data/babeltrace-1.5.8/formats/ctf/ctf.c:471:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, ", within stream id %" PRIu64, stream->stream_id); data/babeltrace-1.5.8/formats/ctf/ctf.c:494:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, ", within stream id %" PRIu64, stream->stream_id); data/babeltrace-1.5.8/formats/ctf/ctf.c:2258: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(index_name, strlen(path) + sizeof(INDEX_PATH), data/babeltrace-1.5.8/formats/ctf/events.c:117: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(&field_underscore[1], field); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:167: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(lvalp->s, src); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:2398:21: [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 YYFPRINTF fprintf data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:46:39: [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 fprintf_dbg(fd, fmt, args...) fprintf(fd, "%s: " fmt, __func__, ## args) data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-parent-links.c:41:39: [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 fprintf_dbg(fd, fmt, args...) fprintf(fd, "%s: " fmt, __func__, ## args) data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-semantic-validator.c:44:39: [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 fprintf_dbg(fd, fmt, args...) fprintf(fd, "%s: " fmt, __func__, ## args) data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-xml.c:41:39: [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 fprintf_dbg(fd, fmt, args...) fprintf(fd, "%s: " fmt, __func__, ## args) data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-xml.c:88:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fd, "%" PRId64, node->u.unary_expression.u.signed_constant); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-xml.c:94:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fd, "%" PRIu64, node->u.unary_expression.u.signed_constant); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:136: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. ret = sscanf(&path[proto_offset], "%[a-zA-Z.0-9%-]%s", data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:142: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. ret = sscanf(remain[0], ":%d%s", &ctx->port, remain[1]); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:145:11: [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. ret = sscanf(remain[1], "/%s", remain[2]); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:158: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. ret = sscanf(remain[0], "/%s", remain[2]); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:183: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. ret = sscanf(remain[2], "host/%[a-zA-Z.0-9%-]/%s", data/babeltrace-1.5.8/include/babeltrace/babeltrace-internal.h:39:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, "[verbose] " fmt, ## args); \ data/babeltrace-1.5.8/include/babeltrace/babeltrace-internal.h:45:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, "[debug] " fmt, ## args); \ data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:173: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(cpath, dirname); data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:175: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(cpath, pathname); data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:176:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return access(cpath, mode); data/babeltrace-1.5.8/include/babeltrace/compat/stdlib.h:43:8: [4] (tmpfile) mktemp: Temporary file race condition (CWE-377). ret = mktemp(template); data/babeltrace-1.5.8/include/babeltrace/compat/uuid.h:113: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(str_out, alloc_str); data/babeltrace-1.5.8/lib/bin-info.c:288: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(build_id_file, BUILD_ID_SUFFIX); data/babeltrace-1.5.8/lib/bin-info.c:387: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(bin_dir, dir_name); data/babeltrace-1.5.8/lib/bin-info.c:399: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, bin_dir); data/babeltrace-1.5.8/lib/bin-info.c:400: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, bin->dbg_link_filename); data/babeltrace-1.5.8/lib/bin-info.c:407: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, bin_dir); data/babeltrace-1.5.8/lib/bin-info.c:408: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, DEBUG_SUBDIR); data/babeltrace-1.5.8/lib/bin-info.c:409: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, bin->dbg_link_filename); data/babeltrace-1.5.8/lib/bin-info.c:416: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, dbg_dir); data/babeltrace-1.5.8/lib/bin-info.c:417: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, bin_dir); data/babeltrace-1.5.8/lib/bin-info.c:418: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, bin->dbg_link_filename); data/babeltrace-1.5.8/lib/bin-info.c:576:8: [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. ret = snprintf(offset_str, ADDR_STR_LEN, "+%#0" PRIx64, offset); data/babeltrace-1.5.8/lib/bin-info.c:580: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(_result, base_str); data/babeltrace-1.5.8/lib/bin-info.c:581: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(_result, offset_str); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:97: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(parser_path, parser_path, (char *) NULL); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:204: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(parser_path, parser_path, trace_path, (char *) NULL); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:721: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(metadata_path, trace_path); data/babeltrace-1.5.8/tests/utils/tap/tap.c:278: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/babeltrace-1.5.8/include/babeltrace/compat/utc.h:55: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. tz = getenv("TZ"); data/babeltrace-1.5.8/lib/babeltrace.c:39: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("BABELTRACE_VERBOSE")) data/babeltrace-1.5.8/lib/babeltrace.c:41: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("BABELTRACE_DEBUG")) data/babeltrace-1.5.8/tests/lib/test_bitfield.c:270:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/babeltrace-1.5.8/tests/utils/tap/tap.c:150: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("HARNESS_ACTIVE") != NULL) data/babeltrace-1.5.8/bindings/python/babeltrace/python-complements.c:37: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(file_path, mode); data/babeltrace-1.5.8/compat/compat_uuid.c:67: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 copy_of_uuid_in[BABELTRACE_UUID_LEN]; data/babeltrace-1.5.8/compat/compat_uuid.c:70: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(copy_of_uuid_in, uuid_in, BABELTRACE_UUID_LEN); data/babeltrace-1.5.8/converter/babeltrace-log.c:59:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 unsigned char s_uuid[BABELTRACE_UUID_LEN]; data/babeltrace-1.5.8/converter/babeltrace-log.c:101: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 uuid_str[BABELTRACE_UUID_STR_LEN]; data/babeltrace-1.5.8/converter/babeltrace-log.c:146: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(ctf_get_pos_addr(pos), uuid, BABELTRACE_UUID_LEN); data/babeltrace-1.5.8/converter/babeltrace-log.c:303: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(ctf_get_pos_addr(pos), tline, tlen); data/babeltrace-1.5.8/converter/babeltrace.c:485:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dirfd = open(fpath, 0); data/babeltrace-1.5.8/formats/ctf-metadata/ctf-metadata.c:101:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path, "w"); data/babeltrace-1.5.8/formats/ctf-text/ctf-text.c:572:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path, "w"); data/babeltrace-1.5.8/formats/ctf/ctf.c:366: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 timestr[26]; data/babeltrace-1.5.8/formats/ctf/ctf.c:1325: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 + 1]; /* + 1 for debug-mode \0 */ data/babeltrace-1.5.8/formats/ctf/ctf.c:1358: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(td->uuid, header.uuid, sizeof(header.uuid)); data/babeltrace-1.5.8/formats/ctf/ctf.c:2348: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). td->dirfd = open(path, 0); data/babeltrace-1.5.8/formats/ctf/ir/clock.c:331: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(clock->uuid, uuid, sizeof(uuid_t)); data/babeltrace-1.5.8/formats/ctf/ir/fields.c:2029: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(&integer_dst->definition, &integer_src->definition, data/babeltrace-1.5.8/formats/ctf/ir/fields.c:2066: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(&float_dst->definition, &float_src->definition, data/babeltrace-1.5.8/formats/ctf/ir/fields.c:2068: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(&float_dst->sign, &float_src->sign, data/babeltrace-1.5.8/formats/ctf/ir/fields.c:2070: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(&float_dst->mantissa, &float_src->mantissa, data/babeltrace-1.5.8/formats/ctf/ir/fields.c:2072: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(&float_dst->exp, &float_src->exp, data/babeltrace-1.5.8/formats/ctf/ir/stream.c:826: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(&packet_context_pos, &stream->pos, data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:296: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 oct_buffer[4]; data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:308: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 hex_buffer[4]; data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:2646: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:2839: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 yymsgbuf[128]; data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2172:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char uuid[BABELTRACE_UUID_LEN]; data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2186: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(trace->uuid, uuid, sizeof(uuid)); data/babeltrace-1.5.8/formats/ctf/types/array.c:85: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((char *) ctf_get_pos_addr(pos), data/babeltrace-1.5.8/formats/ctf/types/float.c:66: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 bits[sizeof(double)]; data/babeltrace-1.5.8/formats/ctf/types/integer.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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/integer.c:180: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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/integer.c:189: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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/integer.c:198: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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/integer.c:210: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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/integer.c:219: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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/integer.c:228: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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/integer.c:237: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(ctf_get_pos_addr(pos), &v, sizeof(v)); data/babeltrace-1.5.8/formats/ctf/types/sequence.c:81: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((char *) ctf_get_pos_addr(pos), data/babeltrace-1.5.8/formats/ctf/types/string.c:67: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(string_definition->value, srcaddr, len); data/babeltrace-1.5.8/formats/ctf/types/string.c:96: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(destaddr, string_definition->value, len); data/babeltrace-1.5.8/formats/ctf/writer/writer.c:83:25: [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). writer->trace_dir_fd = open(path, O_RDONLY, S_IRWXU | S_IRWXG); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:161: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 cmd_buf[cmd_buf_len]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:184: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(cmd_buf, &cmd, sizeof(cmd)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:185: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(cmd_buf + sizeof(cmd), &connect, sizeof(connect)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:434: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 cmd_buf[cmd_buf_len]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:458: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(cmd_buf, &cmd, sizeof(cmd)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:459: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(cmd_buf + sizeof(cmd), &rq, sizeof(rq)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:672: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 cmd_buf[cmd_buf_len]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:696: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(cmd_buf, &cmd, sizeof(cmd)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:697: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(cmd_buf + sizeof(cmd), &rq, sizeof(rq)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:829: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 cmd_buf[cmd_buf_len]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:846: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(cmd_buf, &cmd, sizeof(cmd)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:847: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(cmd_buf + sizeof(cmd), &rq, sizeof(rq)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:1019: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 cmd_buf[cmd_buf_len]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:1033: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(cmd_buf, &cmd, sizeof(cmd)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:1034: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(cmd_buf + sizeof(cmd), &rq, sizeof(rq)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:1338: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(cur_index, prev_index, sizeof(struct packet_index)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:1699: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 cmd_buf[cmd_buf_len]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:1718: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(cmd_buf, &cmd, sizeof(cmd)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:1719: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(cmd_buf + sizeof(cmd), &rq, sizeof(rq)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:106: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 remain[3][MAXNAMLEN] = { { 0 } }; data/babeltrace-1.5.8/formats/lttng-live/lttng-live.h:45: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 traced_hostname[MAXNAMLEN]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live.h:46:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char session_name[MAXNAMLEN]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live.h:47:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char relay_hostname[MAXNAMLEN]; data/babeltrace-1.5.8/formats/lttng-live/lttng-live.h:72:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/babeltrace-1.5.8/formats/lttng-live/lttng-viewer-abi.h:113: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 hostname[LTTNG_VIEWER_HOST_NAME_MAX]; data/babeltrace-1.5.8/formats/lttng-live/lttng-viewer-abi.h:114: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 session_name[LTTNG_VIEWER_NAME_MAX]; data/babeltrace-1.5.8/formats/lttng-live/lttng-viewer-abi.h:121:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path_name[LTTNG_VIEWER_PATH_MAX]; data/babeltrace-1.5.8/formats/lttng-live/lttng-viewer-abi.h:122: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 channel_name[LTTNG_VIEWER_NAME_MAX]; data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:58: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[BABELTRACE_FALLOCATE_BUFLEN]; data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:163: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 cpath[PATH_MAX]; data/babeltrace-1.5.8/include/babeltrace/compat/memstream.h:51: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 tmpname[PATH_MAX]; data/babeltrace-1.5.8/include/babeltrace/compat/memstream.h:63: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). ret = mkstemp(tmpname); data/babeltrace-1.5.8/include/babeltrace/compat/memstream.h:136: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 tmpname[PATH_MAX]; data/babeltrace-1.5.8/include/babeltrace/compat/memstream.h:141: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). ret = mkstemp(tmpname); data/babeltrace-1.5.8/include/babeltrace/compat/string.h:83: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(ret, s, navail); data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h: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 path[PATH_MAX]; /* Path to stream. '\0' for mmap traces */ data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h:185: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 procname[TRACER_ENV_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h:186: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 hostname[TRACER_ENV_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h: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 domain[TRACER_ENV_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h:188: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 sysname[TRACER_ENV_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h: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 release[TRACER_ENV_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h:190: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 version[TRACER_ENV_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h:191: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 tracer_name[TRACER_ENV_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf-ir/metadata.h:220: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 uuid[BABELTRACE_UUID_LEN]; data/babeltrace-1.5.8/include/babeltrace/ctf/types.h:210: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(dummy, pos, sizeof(struct ctf_stream_pos)); data/babeltrace-1.5.8/include/babeltrace/format-internal.h:44:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; /* trace path */ data/babeltrace-1.5.8/include/babeltrace/trace-handle-internal.h:49:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/babeltrace-1.5.8/lib/bin-info.c:141: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(bin->build_id, build_id, build_id_len); data/babeltrace-1.5.8/lib/bin-info.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(path, O_RDONLY); data/babeltrace-1.5.8/lib/bin-info.c:335: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(path, O_RDONLY); data/babeltrace-1.5.8/lib/bin-info.c:497:11: [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(bin->elf_path, O_RDONLY); data/babeltrace-1.5.8/lib/bin-info.c:563: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 offset_str[ADDR_STR_LEN]; data/babeltrace-1.5.8/lib/crc32.c:113: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], *p; data/babeltrace-1.5.8/lib/prio_heap/prio_heap.c:87: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(new_ptrs, heap->ptrs, heap->len * sizeof(void *)); data/babeltrace-1.5.8/lib/prio_heap/prio_heap.c:238: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(dst->ptrs, src->ptrs, src->len * sizeof(void *)); data/babeltrace-1.5.8/tests/lib/test_bin_info.c:56:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/babeltrace-1.5.8/tests/lib/test_bin_info.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 path[PATH_MAX]; data/babeltrace-1.5.8/tests/lib/test_bin_info.c:158:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/babeltrace-1.5.8/tests/lib/test_bin_info.c:199:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/babeltrace-1.5.8/tests/lib/test_bitfield.c:140: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 c[TEST_LEN]; data/babeltrace-1.5.8/tests/lib/test_bitfield.c:203:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. signed char c[TEST_LEN]; data/babeltrace-1.5.8/tests/lib/test_bitfield.c:300: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 c[8]; data/babeltrace-1.5.8/tests/lib/test_bitfield.c:347: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). src = atoi(argv[1]); data/babeltrace-1.5.8/tests/lib/test_bitfield.c:349: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). shift = atoi(argv[2]); data/babeltrace-1.5.8/tests/lib/test_bitfield.c:353: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). len = atoi(argv[3]); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:61:21: [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). parser_output_fd = mkstemp(parser_output_path); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:62:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). metadata_fd = open(metadata_path, O_RDONLY); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:177:25: [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). babeltrace_output_fd = mkstemp(babeltrace_output_path); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:694: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 metadata_path[sizeof(trace_path) + 9]; data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:704: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 hostname[BABELTRACE_HOST_NAME_MAX]; data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:722:2: [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(metadata_path + sizeof(trace_path) - 1, "/metadata"); data/babeltrace-1.5.8/tests/lib/test_ctf_writer.c:836: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 filename[PATH_MAX]; data/babeltrace-1.5.8/tests/lib/test_dwarf.c: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 path[PATH_MAX]; data/babeltrace-1.5.8/tests/lib/test_dwarf.c:46: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(path, O_RDONLY); data/babeltrace-1.5.8/types/enum.c:151: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(ranges->data, qs->data, data/babeltrace-1.5.8/types/enum.c:198: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(ranges->data, qs->data, data/babeltrace-1.5.8/types/types.c:557: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(scope->scope_path->data, parent_scope->scope_path->data, data/babeltrace-1.5.8/types/types.c:594: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, ptrbegin, len); data/babeltrace-1.5.8/compat/compat_uuid.c:76:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(str_out, (char *) alloc_str, BABELTRACE_UUID_STR_LEN); data/babeltrace-1.5.8/converter/babeltrace-log.c:340: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). trace_string(line, &pos, strlen(line) + 1); data/babeltrace-1.5.8/formats/ctf/ctf.c:1456: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). buflen = strlen(*buf); data/babeltrace-1.5.8/formats/ctf/ctf.c:2227:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file_stream->parent.path, path, PATH_MAX); data/babeltrace-1.5.8/formats/ctf/ctf.c:2252: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). index_name = malloc((strlen(path) + sizeof(INDEX_PATH)) * sizeof(char)); data/babeltrace-1.5.8/formats/ctf/ctf.c:2258: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). snprintf(index_name, strlen(path) + sizeof(INDEX_PATH), data/babeltrace-1.5.8/formats/ctf/ctf.c:2355:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(td->parent.path, path, sizeof(td->parent.path)); data/babeltrace-1.5.8/formats/ctf/events.c:115: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). field_underscore = g_new(char, strlen(field) + 2); data/babeltrace-1.5.8/formats/ctf/ir/field-types.c:939:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!string || strlen(string) == 0) { data/babeltrace-1.5.8/formats/ctf/ir/field-types.c:1003:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!string || strlen(string) == 0) { data/babeltrace-1.5.8/formats/ctf/ir/resolve.c:278:5: [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(absolute_path_prefixes[scope]))) { data/babeltrace-1.5.8/formats/ctf/metadata/ctf-lexer.c:900:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/babeltrace-1.5.8/formats/ctf/metadata/ctf-lexer.c:2192: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). return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:166:47: [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). lvalp->s = objstack_alloc(scanner->objstack, strlen(src) + 1); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:348: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(src) + 1; data/babeltrace-1.5.8/formats/ctf/metadata/ctf-parser.c:2546: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). # define yystrlen strlen data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2759:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env->procname, right, TRACER_ENV_LEN); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2775:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env->hostname, right, TRACER_ENV_LEN); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2791:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env->domain, right, TRACER_ENV_LEN); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2807:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env->tracer_name, right, TRACER_ENV_LEN); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2823:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env->sysname, right, TRACER_ENV_LEN); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2839:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env->release, right, TRACER_ENV_LEN); data/babeltrace-1.5.8/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2855:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(env->version, right, TRACER_ENV_LEN); data/babeltrace-1.5.8/formats/ctf/writer/writer.c:267:3: [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(metadata_string)); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-comm.c:307: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(ctx->session_name) == 0) { data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:108: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). size_t path_len = strlen(path); /* not accounting \0 */ data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:122: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). proto_offset = strlen("net://"); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:125: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). proto_offset = strlen("netX://"); data/babeltrace-1.5.8/formats/lttng-live/lttng-live-plugin.c:176: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(remain[2]) == 0) { data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:170: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(dirname) + strlen(pathname) + 2 > PATH_MAX) { data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:170:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(dirname) + strlen(pathname) + 2 > PATH_MAX) { data/babeltrace-1.5.8/include/babeltrace/compat/fcntl.h:174: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(cpath, "/"); data/babeltrace-1.5.8/include/babeltrace/compat/memstream.h:62: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(tmpname, "/tmp/babeltrace-tmp-XXXXXX", PATH_MAX); data/babeltrace-1.5.8/include/babeltrace/compat/memstream.h:140: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(tmpname, "/tmp/babeltrace-tmp-XXXXXX", PATH_MAX); data/babeltrace-1.5.8/include/babeltrace/compat/stdio.h:89:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = fgetc(stream); data/babeltrace-1.5.8/include/babeltrace/compat/string.h:73: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). navail = strlen(s) + 1; data/babeltrace-1.5.8/lib/bin-info.c:276:4: [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(BUILD_ID_SUFFIX) + 1; data/babeltrace-1.5.8/lib/bin-info.c:382: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). bin_dir = malloc(strlen(dir_name) + 2); data/babeltrace-1.5.8/lib/bin-info.c:388: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(bin_dir, "/"); data/babeltrace-1.5.8/lib/bin-info.c:390: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). max_path_len = strlen(dbg_dir) + strlen(bin_dir) + data/babeltrace-1.5.8/lib/bin-info.c:390: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). max_path_len = strlen(dbg_dir) + strlen(bin_dir) + data/babeltrace-1.5.8/lib/bin-info.c:391:4: [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(DEBUG_SUBDIR) + strlen(bin->dbg_link_filename) data/babeltrace-1.5.8/lib/bin-info.c:391: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). strlen(DEBUG_SUBDIR) + strlen(bin->dbg_link_filename) data/babeltrace-1.5.8/lib/bin-info.c:571: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). _result = malloc(strlen(base_str) + ADDR_STR_LEN); data/babeltrace-1.5.8/lib/context.c:123:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(handle->path, path, PATH_MAX); data/babeltrace-1.5.8/lib/crc32.c:119:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((nr = read(fd, buf, sizeof(buf))) > 0) { data/babeltrace-1.5.8/lib/utils.c:30: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). size_t i = strlen(path); ANALYSIS SUMMARY: Hits = 221 Lines analyzed = 64848 in approximately 1.70 seconds (38228 lines/second) Physical Source Lines of Code (SLOC) = 44363 Hits@level = [0] 768 [1] 47 [2] 119 [3] 5 [4] 50 [5] 0 Hits@level+ = [0+] 989 [1+] 221 [2+] 174 [3+] 55 [4+] 50 [5+] 0 Hits/KSLOC@level+ = [0+] 22.2934 [1+] 4.98163 [2+] 3.92219 [3+] 1.23977 [4+] 1.12707 [5+] 0 Dot directories skipped = 2 (--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.