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/device-tree-compiler-1.6.0/checks.c Examining data/device-tree-compiler-1.6.0/data.c Examining data/device-tree-compiler-1.6.0/dtc.c Examining data/device-tree-compiler-1.6.0/dtc.h Examining data/device-tree-compiler-1.6.0/fdtdump.c Examining data/device-tree-compiler-1.6.0/fdtget.c Examining data/device-tree-compiler-1.6.0/fdtoverlay.c Examining data/device-tree-compiler-1.6.0/fdtput.c Examining data/device-tree-compiler-1.6.0/flattree.c Examining data/device-tree-compiler-1.6.0/fstree.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt.h Examining data/device-tree-compiler-1.6.0/libfdt/fdt_addresses.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_check.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_empty_tree.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_overlay.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_strerror.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_sw.c Examining data/device-tree-compiler-1.6.0/libfdt/fdt_wip.c Examining data/device-tree-compiler-1.6.0/libfdt/libfdt.h Examining data/device-tree-compiler-1.6.0/libfdt/libfdt_env.h Examining data/device-tree-compiler-1.6.0/libfdt/libfdt_internal.h Examining data/device-tree-compiler-1.6.0/livetree.c Examining data/device-tree-compiler-1.6.0/srcpos.c Examining data/device-tree-compiler-1.6.0/srcpos.h Examining data/device-tree-compiler-1.6.0/tests/add_subnode_with_nops.c Examining data/device-tree-compiler-1.6.0/tests/addr_size_cells.c Examining data/device-tree-compiler-1.6.0/tests/addr_size_cells2.c Examining data/device-tree-compiler-1.6.0/tests/appendprop1.c Examining data/device-tree-compiler-1.6.0/tests/appendprop2.c Examining data/device-tree-compiler-1.6.0/tests/appendprop_addrrange.c Examining data/device-tree-compiler-1.6.0/tests/asm_tree_dump.c Examining data/device-tree-compiler-1.6.0/tests/boot-cpuid.c Examining data/device-tree-compiler-1.6.0/tests/char_literal.c Examining data/device-tree-compiler-1.6.0/tests/check_full.c Examining data/device-tree-compiler-1.6.0/tests/check_header.c Examining data/device-tree-compiler-1.6.0/tests/check_path.c Examining data/device-tree-compiler-1.6.0/tests/del_node.c Examining data/device-tree-compiler-1.6.0/tests/del_property.c Examining data/device-tree-compiler-1.6.0/tests/dtb_reverse.c Examining data/device-tree-compiler-1.6.0/tests/dtbs_equal_ordered.c Examining data/device-tree-compiler-1.6.0/tests/dtbs_equal_unordered.c Examining data/device-tree-compiler-1.6.0/tests/dumptrees.c Examining data/device-tree-compiler-1.6.0/tests/extra-terminating-null.c Examining data/device-tree-compiler-1.6.0/tests/find_property.c Examining data/device-tree-compiler-1.6.0/tests/fs_tree1.c Examining data/device-tree-compiler-1.6.0/tests/get_alias.c Examining data/device-tree-compiler-1.6.0/tests/get_mem_rsv.c Examining data/device-tree-compiler-1.6.0/tests/get_name.c Examining data/device-tree-compiler-1.6.0/tests/get_path.c Examining data/device-tree-compiler-1.6.0/tests/get_phandle.c Examining data/device-tree-compiler-1.6.0/tests/get_prop_offset.c Examining data/device-tree-compiler-1.6.0/tests/getprop.c Examining data/device-tree-compiler-1.6.0/tests/incbin.c Examining data/device-tree-compiler-1.6.0/tests/integer-expressions.c Examining data/device-tree-compiler-1.6.0/tests/mangle-layout.c Examining data/device-tree-compiler-1.6.0/tests/move_and_save.c Examining data/device-tree-compiler-1.6.0/tests/node_check_compatible.c Examining data/device-tree-compiler-1.6.0/tests/node_offset_by_compatible.c Examining data/device-tree-compiler-1.6.0/tests/node_offset_by_phandle.c Examining data/device-tree-compiler-1.6.0/tests/node_offset_by_prop_value.c Examining data/device-tree-compiler-1.6.0/tests/nop_node.c Examining data/device-tree-compiler-1.6.0/tests/nop_property.c Examining data/device-tree-compiler-1.6.0/tests/nopulate.c Examining data/device-tree-compiler-1.6.0/tests/notfound.c Examining data/device-tree-compiler-1.6.0/tests/open_pack.c Examining data/device-tree-compiler-1.6.0/tests/overlay.c Examining data/device-tree-compiler-1.6.0/tests/overlay_bad_fixup.c Examining data/device-tree-compiler-1.6.0/tests/parent_offset.c Examining data/device-tree-compiler-1.6.0/tests/path-references.c Examining data/device-tree-compiler-1.6.0/tests/path_offset.c Examining data/device-tree-compiler-1.6.0/tests/path_offset_aliases.c Examining data/device-tree-compiler-1.6.0/tests/phandle_format.c Examining data/device-tree-compiler-1.6.0/tests/property_iterate.c Examining data/device-tree-compiler-1.6.0/tests/propname_escapes.c Examining data/device-tree-compiler-1.6.0/tests/references.c Examining data/device-tree-compiler-1.6.0/tests/root_node.c Examining data/device-tree-compiler-1.6.0/tests/rw_oom.c Examining data/device-tree-compiler-1.6.0/tests/rw_tree1.c Examining data/device-tree-compiler-1.6.0/tests/set_name.c Examining data/device-tree-compiler-1.6.0/tests/setprop.c Examining data/device-tree-compiler-1.6.0/tests/setprop_inplace.c Examining data/device-tree-compiler-1.6.0/tests/sized_cells.c Examining data/device-tree-compiler-1.6.0/tests/string_escapes.c Examining data/device-tree-compiler-1.6.0/tests/stringlist.c Examining data/device-tree-compiler-1.6.0/tests/subnode_iterate.c Examining data/device-tree-compiler-1.6.0/tests/subnode_offset.c Examining data/device-tree-compiler-1.6.0/tests/supernode_atdepth_offset.c Examining data/device-tree-compiler-1.6.0/tests/sw_states.c Examining data/device-tree-compiler-1.6.0/tests/sw_tree1.c Examining data/device-tree-compiler-1.6.0/tests/testdata.h Examining data/device-tree-compiler-1.6.0/tests/tests.h Examining data/device-tree-compiler-1.6.0/tests/testutils.c Examining data/device-tree-compiler-1.6.0/tests/truncated_memrsv.c Examining data/device-tree-compiler-1.6.0/tests/truncated_property.c Examining data/device-tree-compiler-1.6.0/tests/truncated_string.c Examining data/device-tree-compiler-1.6.0/tests/utilfdt_test.c Examining data/device-tree-compiler-1.6.0/tests/value-labels.c Examining data/device-tree-compiler-1.6.0/treesource.c Examining data/device-tree-compiler-1.6.0/util.c Examining data/device-tree-compiler-1.6.0/util.h Examining data/device-tree-compiler-1.6.0/yamltree.c FINAL RESULTS: data/device-tree-compiler-1.6.0/checks.c:13: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(stderr, __VA_ARGS__); \ data/device-tree-compiler-1.6.0/checks.c:988: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(unit_addr, sizeof(unit_addr), "%"PRIx64, reg); data/device-tree-compiler-1.6.0/dtc.h:27:20: [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. #define debug(...) printf(__VA_ARGS__) data/device-tree-compiler-1.6.0/fdtdump.c:45:18: [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. do { if (debug) printf("// " fmt, ## args); } while (0) data/device-tree-compiler-1.6.0/fdtget.c:67:3: [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. printf(fmt, value); data/device-tree-compiler-1.6.0/fdtput.c:97: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(*arg, fmt, &ival); data/device-tree-compiler-1.6.0/srcpos.c:83: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(res + j, p1); data/device-tree-compiler-1.6.0/srcpos.c:381: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, va); data/device-tree-compiler-1.6.0/tests/dtb_reverse.c:131:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "%s.reversed.test.dtb", argv[1]); data/device-tree-compiler-1.6.0/tests/mangle-layout.c:123:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "v%d.%s.%s", version, blockorder, inname); data/device-tree-compiler-1.6.0/tests/move_and_save.c:42:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "moved.%s", inname); data/device-tree-compiler-1.6.0/tests/move_and_save.c:50:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "shunted.%s", inname); data/device-tree-compiler-1.6.0/tests/move_and_save.c:58:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "deshunted.%s", inname); data/device-tree-compiler-1.6.0/tests/nopulate.c:56:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "noppy.%s", inname); data/device-tree-compiler-1.6.0/tests/open_pack.c:44:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "opened.%s", inname); data/device-tree-compiler-1.6.0/tests/open_pack.c:50:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(outname, "repacked.%s", inname); data/device-tree-compiler-1.6.0/tests/tests.h:33:3: [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. printf(__VA_ARGS__); \ data/device-tree-compiler-1.6.0/tests/tests.h:37:29: [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 ERROR(fmt, args...) fprintf(stderr, ERR fmt, ## args) data/device-tree-compiler-1.6.0/tests/utilfdt_test.c:60: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(fmt, modifier); data/device-tree-compiler-1.6.0/treesource.c:96: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. fprintf(f, "\\x%02"PRIx8, c); data/device-tree-compiler-1.6.0/treesource.c:110: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(f, "%02"PRIx8, *(const uint8_t*)p); data/device-tree-compiler-1.6.0/treesource.c:113: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(f, "0x%02"PRIx16, fdt16_to_cpu(*(const fdt16_t*)p)); data/device-tree-compiler-1.6.0/treesource.c:116: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(f, "0x%02"PRIx32, fdt32_to_cpu(*(const fdt32_t*)p)); data/device-tree-compiler-1.6.0/treesource.c:119: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(f, "0x%02"PRIx64, fdt64_to_cpu(*(const fdt64_t*)p)); data/device-tree-compiler-1.6.0/treesource.c:265: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(f, pos == len ? "%s" : "%s,", data/device-tree-compiler-1.6.0/util.c:47:6: [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. n = vsnprintf(NULL, 0, fmt, ap_copy) + 1; data/device-tree-compiler-1.6.0/util.c:52:6: [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. n = vsnprintf(p + size, n, fmt, ap); data/device-tree-compiler-1.6.0/util.h:16:45: [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. #define PRINTF(i, j) __attribute__((format (printf, i, j))) data/device-tree-compiler-1.6.0/util.h:37: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, str, ap); data/device-tree-compiler-1.6.0/yamltree.c:59:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, "0x%"PRIx8, *(uint8_t*)(data + off)); data/device-tree-compiler-1.6.0/yamltree.c:62:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, "0x%"PRIx16, fdt16_to_cpu(*(fdt16_t*)(data + off))); data/device-tree-compiler-1.6.0/yamltree.c:65:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, "0x%"PRIx32, fdt32_to_cpu(*(fdt32_t*)(data + off))); data/device-tree-compiler-1.6.0/yamltree.c:76:4: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, "0x%"PRIx64, fdt64_to_cpu(*(fdt64_t*)(data + off))); data/device-tree-compiler-1.6.0/tests/testutils.c:68: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("QUIET_TEST")) data/device-tree-compiler-1.6.0/util.h:219:28: [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. #define util_getopt_long() getopt_long(argc, argv, usage_short_opts, \ data/device-tree-compiler-1.6.0/checks.c:886: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 unit_addr[5]; data/device-tree-compiler-1.6.0/checks.c:960: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 unit_addr[17]; data/device-tree-compiler-1.6.0/checks.c:1029: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 unit_addr[17]; data/device-tree-compiler-1.6.0/checks.c:1111: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 unit_addr[9]; data/device-tree-compiler-1.6.0/checks.c:1679: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 unit_addr[9]; data/device-tree-compiler-1.6.0/data.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(d.val, mem, len); data/device-tree-compiler-1.6.0/data.c:110: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(d.val + d.len, p, len); data/device-tree-compiler-1.6.0/data.c:120: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(d.val + m->offset, p, len); data/device-tree-compiler-1.6.0/dtc.c:145:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(fname, "r"); data/device-tree-compiler-1.6.0/dtc.c:279: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). depfile = fopen(depname, "w"); data/device-tree-compiler-1.6.0/dtc.c:344:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). outf = fopen(outname, "wb"); data/device-tree-compiler-1.6.0/fdtdump.c:216: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 smagic[FDT_MAGIC_SIZE]; data/device-tree-compiler-1.6.0/fdtget.c:55: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 fmt[3]; data/device-tree-compiler-1.6.0/fdtoverlay.c:68: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(tmpo, overlay, fdt_totalsize(overlay)); data/device-tree-compiler-1.6.0/fdtput.c:67: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 fmt[3]; data/device-tree-compiler-1.6.0/fdtput.c:92: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(ptr, *arg, len); data/device-tree-compiler-1.6.0/flattree.c:581: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(p, inb->ptr, len); data/device-tree-compiler-1.6.0/fstree.c:40:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). pfile = fopen(tmpname, "rb"); data/device-tree-compiler-1.6.0/libfdt/fdt.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 name[0]; data/device-tree-compiler-1.6.0/libfdt/fdt.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 data[0]; data/device-tree-compiler-1.6.0/libfdt/fdt_overlay.c:816: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(buf, target_path, len + 1); data/device-tree-compiler-1.6.0/libfdt/fdt_overlay.c:822: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 + len + 1, rel_path, rel_path_len); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:566: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(buf + p, name, namelen); data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:150: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, s, len); data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:253: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(namep, name, newlen+1); data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:286: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(prop_data, val, len); data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:307: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(prop->data + oldlen, val, len); data/device-tree-compiler-1.6.0/libfdt/fdt_rw.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(prop->data, val, len); data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:366: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(nh->name, name, namelen); data/device-tree-compiler-1.6.0/libfdt/fdt_sw.c:229: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(nh->name, name, namelen); data/device-tree-compiler-1.6.0/libfdt/fdt_sw.c:259: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(strtab + offset, s, len); data/device-tree-compiler-1.6.0/libfdt/fdt_sw.c:330: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(ptr, val, len); data/device-tree-compiler-1.6.0/libfdt/fdt_wip.c:29: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((char *)propval + idx, val, len); data/device-tree-compiler-1.6.0/srcpos.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(dir, path, len); data/device-tree-compiler-1.6.0/srcpos.c:109: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(fullname, "rb"); data/device-tree-compiler-1.6.0/srcpos.c:264: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(pos_new, pos, sizeof(struct srcpos)); data/device-tree-compiler-1.6.0/srcpos.c:268: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(srcfile_state, pos->file, sizeof(struct srcfile_state)); data/device-tree-compiler-1.6.0/tests/dtb_reverse.c:76: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/device-tree-compiler-1.6.0/tests/dtb_reverse.c:94: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/device-tree-compiler-1.6.0/tests/dtb_reverse.c: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 outname[PATH_MAX]; data/device-tree-compiler-1.6.0/tests/dtbs_equal_unordered.c:123:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. verbose_printf(" %02x", ((const char *)data1)[i]); data/device-tree-compiler-1.6.0/tests/dtbs_equal_unordered.c:126:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. verbose_printf(" %02x", ((const char *)data2)[i]); data/device-tree-compiler-1.6.0/tests/dtbs_equal_unordered.c:169:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path1[PATH_MAX], path2[PATH_MAX]; data/device-tree-compiler-1.6.0/tests/dumptrees.c:56:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); data/device-tree-compiler-1.6.0/tests/extra-terminating-null.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 checkbuf[len+numnulls]; data/device-tree-compiler-1.6.0/tests/extra-terminating-null.c:23: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(checkbuf, TEST_STRING_1, len); data/device-tree-compiler-1.6.0/tests/fs_tree1.c:50: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(name, O_WRONLY|O_CREAT, 0666); data/device-tree-compiler-1.6.0/tests/get_path.c:22: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[buflen+1]; data/device-tree-compiler-1.6.0/tests/incbin.c:28:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(name, "r"); data/device-tree-compiler-1.6.0/tests/integer-expressions.c:67: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 *f = fopen(argv[2], "w"); data/device-tree-compiler-1.6.0/tests/mangle-layout.c:85: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->buf + offset, src, size); data/device-tree-compiler-1.6.0/tests/mangle-layout.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 outname[PATH_MAX]; data/device-tree-compiler-1.6.0/tests/mangle-layout.c:121: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). version = atoi(argv[2]); data/device-tree-compiler-1.6.0/tests/move_and_save.c:27: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 outname[PATH_MAX]; data/device-tree-compiler-1.6.0/tests/nopulate.c:31: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, (const char *)fdt + fdt_off_dt_struct(fdt) + offset, data/device-tree-compiler-1.6.0/tests/nopulate.c:48:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char outname[PATH_MAX]; data/device-tree-compiler-1.6.0/tests/nopulate.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(fdt2, fdt, struct_start); data/device-tree-compiler-1.6.0/tests/nopulate.c:77: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(fdt2 + struct_start, buf, newsize); data/device-tree-compiler-1.6.0/tests/nopulate.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(fdt2 + struct_end_new, fdt + struct_end_old, data/device-tree-compiler-1.6.0/tests/open_pack.c:26: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 outname[PATH_MAX]; data/device-tree-compiler-1.6.0/tests/sw_tree1.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(place, place_str, place_len); data/device-tree-compiler-1.6.0/tests/testutils.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(p, &val, sizeof(val)); data/device-tree-compiler-1.6.0/tests/testutils.c:216: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(p, &val, sizeof(val)); data/device-tree-compiler-1.6.0/tests/utilfdt_test.c:55: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 fmt[10], *ptr; data/device-tree-compiler-1.6.0/tests/utilfdt_test.c:80: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 fmt[10]; data/device-tree-compiler-1.6.0/util.c:31: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(d, s, len); data/device-tree-compiler-1.6.0/util.c:99: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(str, path, lenp); data/device-tree-compiler-1.6.0/util.c:104: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(str+lenp, name, lenn+1); data/device-tree-compiler-1.6.0/util.c:146: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 x[4]; data/device-tree-compiler-1.6.0/util.c:169:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char x[3]; data/device-tree-compiler-1.6.0/util.c:244:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(filename, O_RDONLY); data/device-tree-compiler-1.6.0/util.c:300:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); data/device-tree-compiler-1.6.0/yamltree.c:53: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/device-tree-compiler-1.6.0/checks.c:308: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). if (n < strlen(node->name)) data/device-tree-compiler-1.6.0/checks.c:368:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (n < strlen(prop->name)) data/device-tree-compiler-1.6.0/checks.c:385:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (n == strlen(prop->name)) data/device-tree-compiler-1.6.0/checks.c:400:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (n < strlen(name)) data/device-tree-compiler-1.6.0/checks.c:637: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(path) + 1); data/device-tree-compiler-1.6.0/checks.c:704: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). if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name)) data/device-tree-compiler-1.6.0/checks.c:1241: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(addr_a)) data/device-tree-compiler-1.6.0/dtc.c:42: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). tree->basenamelen = strlen(tree->name); data/device-tree-compiler-1.6.0/dtc.h:56:54: [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 strstarts(s, prefix) (strncmp((s), (prefix), strlen(prefix)) == 0) data/device-tree-compiler-1.6.0/dtc.h:57: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). #define strprefixeq(a, n, b) (strlen(b) == (n) && (memcmp(a, b, n) == 0)) data/device-tree-compiler-1.6.0/fdtdump.c:109: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). p = PALIGN(p + strlen(s) + 1, 4); data/device-tree-compiler-1.6.0/fdtget.c:101: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). for (s = data; s - data < len; s += strlen(s) + 1) { data/device-tree-compiler-1.6.0/fdtput.c:44: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). namelen = strlen(name); data/device-tree-compiler-1.6.0/fdtput.c:80: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(*arg) + 1; data/device-tree-compiler-1.6.0/fdtput.c:131: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). delta = sizeof(struct fdt_node_header) + ALIGN(strlen(name) + 1) data/device-tree-compiler-1.6.0/fdtput.c:144: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). delta = sizeof(struct fdt_property) + strlen(name) + 1; data/device-tree-compiler-1.6.0/fdtput.c:201: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). sep = path + strlen(path); data/device-tree-compiler-1.6.0/flattree.c:57: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(str); data/device-tree-compiler-1.6.0/flattree.c:231: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). *d = data_append_data(*d, str, strlen(str)+1); data/device-tree-compiler-1.6.0/flattree.c:440: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(p); data/device-tree-compiler-1.6.0/flattree.c:717: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). plen = strlen(ppath); data/device-tree-compiler-1.6.0/libfdt/fdt.c:297:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(s) + 1; data/device-tree-compiler-1.6.0/libfdt/fdt_overlay.c:272: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(name), data/device-tree-compiler-1.6.0/libfdt/fdt_overlay.c:793: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(target_path); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:46:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *lenp = strlen(s); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:245:61: [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 fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name)); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:295:44: [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 fdt_path_offset_namelen(fdt, path, strlen(path)); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:326: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(nameptr); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:446:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(name), lenp); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:503:52: [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 fdt_getprop_namelen(fdt, nodeoffset, name, strlen(name), lenp); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:537:42: [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 fdt_get_alias_namelen(fdt, name, strlen(name)); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:706:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(str); data/device-tree-compiler-1.6.0/libfdt/fdt_ro.c:756: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(string) + 1; data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:99: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). int newlen = strlen(s) + 1; data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:131:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(s) + 1; data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:246: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). newlen = strlen(name); data/device-tree-compiler-1.6.0/libfdt/fdt_rw.c:375:58: [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 fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name)); data/device-tree-compiler-1.6.0/libfdt/fdt_sw.c:223:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). namelen = strlen(name) + 1; data/device-tree-compiler-1.6.0/libfdt/fdt_sw.c:251:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(s) + 1; data/device-tree-compiler-1.6.0/libfdt/fdt_sw.c:268:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(s) + 1; data/device-tree-compiler-1.6.0/libfdt/fdt_wip.c:47: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(name), 0, data/device-tree-compiler-1.6.0/libfdt/libfdt.h:1470: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). fdt_property(fdt, name, str, strlen(str)+1) data/device-tree-compiler-1.6.0/libfdt/libfdt.h:1728: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). fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1) data/device-tree-compiler-1.6.0/libfdt/libfdt.h:1899:53: [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). fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1) data/device-tree-compiler-1.6.0/livetree.c:238: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). d = data_append_data(d, ref, strlen(ref) + 1); data/device-tree-compiler-1.6.0/livetree.c:543: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). assert(label && (strlen(label) > 0)); data/device-tree-compiler-1.6.0/livetree.c:850: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). strlen(node->fullpath)), data/device-tree-compiler-1.6.0/livetree.c:901:40: [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). append_to_property(fn, m->ref, entry, strlen(entry) + 1, TYPE_STRING); data/device-tree-compiler-1.6.0/srcpos.c:49: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). int i, len = strlen(fname); data/device-tree-compiler-1.6.0/srcpos.c:74: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). int restlen = strlen(fname) - (p1 - fname); data/device-tree-compiler-1.6.0/tests/del_property.c:48:43: [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). strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, data/device-tree-compiler-1.6.0/tests/extra-terminating-null.c:19:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(str); data/device-tree-compiler-1.6.0/tests/find_property.c:25: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). check_property(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, TEST_STRING_1); data/device-tree-compiler-1.6.0/tests/get_name.c:42:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (len != strlen(getname)) data/device-tree-compiler-1.6.0/tests/get_name.c:44: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). path, len, strlen(getname)); data/device-tree-compiler-1.6.0/tests/get_path.c:57: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 pathlen = strlen(path); data/device-tree-compiler-1.6.0/tests/get_prop_offset.c:33: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). strlen(TEST_STRING_1) + 1, data/device-tree-compiler-1.6.0/tests/getprop.c:26: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). check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, TEST_STRING_1); data/device-tree-compiler-1.6.0/tests/node_offset_by_prop_value.c:53:40: [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). vcheck_search(fdt, propname, propval, strlen(propval)+1, ap); data/device-tree-compiler-1.6.0/tests/nop_property.c:43:43: [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). strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, data/device-tree-compiler-1.6.0/tests/parent_offset.c:36:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(parentpath, path, pathparentlen); data/device-tree-compiler-1.6.0/tests/path-references.c:72: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). multilen = strlen("/node1") + strlen("/node2") + 2; data/device-tree-compiler-1.6.0/tests/path-references.c:72: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). multilen = strlen("/node1") + strlen("/node2") + 2; data/device-tree-compiler-1.6.0/tests/path-references.c:79: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). if ((!streq(p, "/node1") || !streq(p + strlen("/node1") + 1, "/node2"))) data/device-tree-compiler-1.6.0/tests/root_node.c:34: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(nh->name) != 0) data/device-tree-compiler-1.6.0/tests/set_name.c:42:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (len != strlen(getname)) data/device-tree-compiler-1.6.0/tests/set_name.c:44: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). path, len, strlen(getname)); data/device-tree-compiler-1.6.0/tests/set_name.c:59:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (len != strlen(getname)) data/device-tree-compiler-1.6.0/tests/set_name.c:61: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). path, len, strlen(getname)); data/device-tree-compiler-1.6.0/tests/setprop.c:52:43: [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). strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, data/device-tree-compiler-1.6.0/tests/setprop_inplace.c:43:43: [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). strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, data/device-tree-compiler-1.6.0/tests/setprop_inplace.c:57:43: [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). strp = check_getprop(fdt, 0, "prop-str", strlen(TEST_STRING_1)+1, data/device-tree-compiler-1.6.0/tests/setprop_inplace.c:62: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). xlen = strlen(xstr); data/device-tree-compiler-1.6.0/tests/setprop_inplace.c:74: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("compatible"), 4, data/device-tree-compiler-1.6.0/tests/setprop_inplace.c:76: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(TEST_STRING_4_PARTIAL)); data/device-tree-compiler-1.6.0/tests/setprop_inplace.c:80:38: [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). check_getprop(fdt, 0, "compatible", strlen(TEST_STRING_4_RESULT) + 1, data/device-tree-compiler-1.6.0/tests/string_escapes.c:25: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(TEST_STRING_2)+1, TEST_STRING_2); data/device-tree-compiler-1.6.0/tests/string_escapes.c:27: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(TEST_STRING_3)+1, TEST_STRING_3); data/device-tree-compiler-1.6.0/tests/supernode_atdepth_offset.c:66:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(superpath, path, pathprefixlen); data/device-tree-compiler-1.6.0/tests/tests.h:107:45: [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). check_getprop((fdt), (nodeoffset), (name), strlen(s)+1, (s)) data/device-tree-compiler-1.6.0/tests/testutils.c:115: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 (namelen != strlen(propname)) data/device-tree-compiler-1.6.0/tests/testutils.c:117: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). namelen, strlen(propname)); data/device-tree-compiler-1.6.0/tests/testutils.c:235:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(s2); data/device-tree-compiler-1.6.0/tests/utilfdt_test.c:58: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(modifier) + 2 >= sizeof(fmt)) data/device-tree-compiler-1.6.0/tests/utilfdt_test.c:61: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). ptr = fmt + strlen(fmt); data/device-tree-compiler-1.6.0/util.c:28:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(s) + 1; data/device-tree-compiler-1.6.0/util.c:44: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). size = strlen(p); data/device-tree-compiler-1.6.0/util.c:55: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). return strlen(p); data/device-tree-compiler-1.6.0/util.c:86: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). int lenp = strlen(path); data/device-tree-compiler-1.6.0/util.c:87: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). int lenn = strlen(name); data/device-tree-compiler-1.6.0/util.c:151:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(x, s + *i, 3); data/device-tree-compiler-1.6.0/util.c:174:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(x, s + *i, 2); data/device-tree-compiler-1.6.0/util.c:258:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, &buf[offset], bufsize - offset); data/device-tree-compiler-1.6.0/util.c:387: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). s += strlen(s) + 1; data/device-tree-compiler-1.6.0/util.c:422: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). size_t a_arg_len = strlen(a_arg) + 1; data/device-tree-compiler-1.6.0/util.c:435: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). int l = strlen(long_opts[i].name) + 1; data/device-tree-compiler-1.6.0/util.c:457: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). (int)(optlen - strlen(long_opts[i].name) - a_arg_len), ""); data/device-tree-compiler-1.6.0/yamltree.c:83: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(buf), 0, 0, YAML_PLAIN_SCALAR_STYLE); data/device-tree-compiler-1.6.0/yamltree.c:87: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(buf), 1, 1, YAML_PLAIN_SCALAR_STYLE); data/device-tree-compiler-1.6.0/yamltree.c:121: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(prop->name), 1, 1, YAML_PLAIN_SCALAR_STYLE); data/device-tree-compiler-1.6.0/yamltree.c:129: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("true"), 1, 0, YAML_PLAIN_SCALAR_STYLE); data/device-tree-compiler-1.6.0/yamltree.c:196: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(child->name), 1, 0, YAML_PLAIN_SCALAR_STYLE); ANALYSIS SUMMARY: Hits = 210 Lines analyzed = 20013 in approximately 0.52 seconds (38128 lines/second) Physical Source Lines of Code (SLOC) = 13229 Hits@level = [0] 184 [1] 102 [2] 73 [3] 2 [4] 33 [5] 0 Hits@level+ = [0+] 394 [1+] 210 [2+] 108 [3+] 35 [4+] 33 [5+] 0 Hits/KSLOC@level+ = [0+] 29.7831 [1+] 15.8742 [2+] 8.16388 [3+] 2.6457 [4+] 2.49452 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.