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/drbd-utils-9.15.0/drbd-headers/windrbd/windrbd_ioctl.h Examining data/drbd-utils-9.15.0/drbd-headers/drbd_strings.h Examining data/drbd-utils-9.15.0/drbd-headers/drbd_transport.h Examining data/drbd-utils-9.15.0/drbd-headers/drbd_meta_data.h Examining data/drbd-utils-9.15.0/drbd-headers/drbd_protocol.h Examining data/drbd-utils-9.15.0/drbd-headers/drbd_strings.c Examining data/drbd-utils-9.15.0/drbd-headers/compat.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/drbd.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/drbd_genl.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/drbd_genl_api.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/genl_magic_func-genl_register_family_with_ops_groups.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/genl_magic_func.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/drbd_limits.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/genl_magic_struct.h Examining data/drbd-utils-9.15.0/drbd-headers/linux/genl_magic_func-genl_register_mc_group.h Examining data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c Examining data/drbd-utils-9.15.0/user/v84/config_flags.h Examining data/drbd-utils-9.15.0/user/v84/drbdsetup_colors.h Examining data/drbd-utils-9.15.0/user/v84/registry.c Examining data/drbd-utils-9.15.0/user/v84/drbd_strings.h Examining data/drbd-utils-9.15.0/user/v84/drbd_nla.h Examining data/drbd-utils-9.15.0/user/v84/config_flags.c Examining data/drbd-utils-9.15.0/user/v84/drbdadm.h Examining data/drbd-utils-9.15.0/user/v84/drbd_strings.c Examining data/drbd-utils-9.15.0/user/v84/drbdtool_common.c Examining data/drbd-utils-9.15.0/user/v84/drbdsetup.c Examining data/drbd-utils-9.15.0/user/v84/drbd_nla.c Examining data/drbd-utils-9.15.0/user/v84/drbdsetup_colors.c Examining data/drbd-utils-9.15.0/user/v84/drbdadm_parser.h Examining data/drbd-utils-9.15.0/user/v84/linux/drbd.h Examining data/drbd-utils-9.15.0/user/v84/linux/drbd_genl.h Examining data/drbd-utils-9.15.0/user/v84/linux/drbd_config.h Examining data/drbd-utils-9.15.0/user/v84/linux/drbd_genl_api.h Examining data/drbd-utils-9.15.0/user/v84/linux/genl_magic_func.h Examining data/drbd-utils-9.15.0/user/v84/linux/drbd_limits.h Examining data/drbd-utils-9.15.0/user/v84/linux/genl_magic_struct.h Examining data/drbd-utils-9.15.0/user/v84/drbdtool_common.h Examining data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c Examining data/drbd-utils-9.15.0/user/v84/registry.h Examining data/drbd-utils-9.15.0/user/v84/drbdadm_main.c Examining data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c Examining data/drbd-utils-9.15.0/user/windrbd/windrbd.c Examining data/drbd-utils-9.15.0/user/drbdmon/StringTokenizer.h Examining data/drbd-utils-9.15.0/user/drbdmon/StringTokenizer.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/colormodes.h Examining data/drbd-utils-9.15.0/user/drbdmon/EventsIo.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/cppdsaext/src/dsaext.h Examining data/drbd-utils-9.15.0/user/drbdmon/cppdsaext/src/integerparse.h Examining data/drbd-utils-9.15.0/user/drbdmon/cppdsaext/src/QTree.h Examining data/drbd-utils-9.15.0/user/drbdmon/cppdsaext/src/dsaext.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/cppdsaext/src/integerparse.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/cppdsaext/src/VMap.h Examining data/drbd-utils-9.15.0/user/drbdmon/cppdsaext/src/integerparse_impl.h Examining data/drbd-utils-9.15.0/user/drbdmon/EventsIo.h Examining data/drbd-utils-9.15.0/user/drbdmon/Configurable.h Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdMon.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/MessageLog.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/exceptions.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/CompactDisplay.h Examining data/drbd-utils-9.15.0/user/drbdmon/Args.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdVolume.h Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdConnection.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/StateFlags.h Examining data/drbd-utils-9.15.0/user/drbdmon/EventsSourceSpawner.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/VolumesContainer.h Examining data/drbd-utils-9.15.0/user/drbdmon/ConfigOption.h Examining data/drbd-utils-9.15.0/user/drbdmon/EventsSourceSpawner.h Examining data/drbd-utils-9.15.0/user/drbdmon/StateFlags.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/map_types.h Examining data/drbd-utils-9.15.0/user/drbdmon/exceptions.h Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdMon.h Examining data/drbd-utils-9.15.0/user/drbdmon/comparators.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/comparators.h Examining data/drbd-utils-9.15.0/user/drbdmon/IntervalTimer.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/Display.h Examining data/drbd-utils-9.15.0/user/drbdmon/Args.h Examining data/drbd-utils-9.15.0/user/drbdmon/CompactDisplay.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdConnection.h Examining data/drbd-utils-9.15.0/user/drbdmon/ConfigOption.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/VolumesContainer.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdRole.h Examining data/drbd-utils-9.15.0/user/drbdmon/utils.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdResource.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/Configurator.h Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdRole.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/utils.h Examining data/drbd-utils-9.15.0/user/drbdmon/MessageLog.h Examining data/drbd-utils-9.15.0/user/drbdmon/Display.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdVolume.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/DrbdResource.h Examining data/drbd-utils-9.15.0/user/drbdmon/IntervalTimer.h Examining data/drbd-utils-9.15.0/user/drbdmon/drbdmon_main.cpp Examining data/drbd-utils-9.15.0/user/drbdmon/GenericDisplay.h Examining data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c Examining data/drbd-utils-9.15.0/user/v83/drbdadm.h Examining data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c Examining data/drbd-utils-9.15.0/user/v83/drbd_strings.c Examining data/drbd-utils-9.15.0/user/v83/drbdtool_common.c Examining data/drbd-utils-9.15.0/user/v83/drbdsetup.c Examining data/drbd-utils-9.15.0/user/v83/unaligned.h Examining data/drbd-utils-9.15.0/user/v83/drbdadm_parser.h Examining data/drbd-utils-9.15.0/user/v83/linux/drbd.h Examining data/drbd-utils-9.15.0/user/v83/linux/drbd_config.h Examining data/drbd-utils-9.15.0/user/v83/linux/drbd_nl.h Examining data/drbd-utils-9.15.0/user/v83/linux/drbd_limits.h Examining data/drbd-utils-9.15.0/user/v83/linux/drbd_tag_magic.h Examining data/drbd-utils-9.15.0/user/v83/drbdtool_common.h Examining data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c Examining data/drbd-utils-9.15.0/user/v83/drbdadm_main.c Examining data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c Examining data/drbd-utils-9.15.0/user/shared/shared_parser.c Examining data/drbd-utils-9.15.0/user/shared/shared_windrbd.h Examining data/drbd-utils-9.15.0/user/shared/shared_windrbd.c Examining data/drbd-utils-9.15.0/user/shared/shared_main.h Examining data/drbd-utils-9.15.0/user/shared/shared_main.c Examining data/drbd-utils-9.15.0/user/shared/drbdmeta_windrbd.c Examining data/drbd-utils-9.15.0/user/shared/drbd_endian.h Examining data/drbd-utils-9.15.0/user/shared/libgenl.h Examining data/drbd-utils-9.15.0/user/shared/drbd_buildtag.h Examining data/drbd-utils-9.15.0/user/shared/drbdmeta.c Examining data/drbd-utils-9.15.0/user/shared/shared_tool.c Examining data/drbd-utils-9.15.0/user/shared/wrap_printf.c Examining data/drbd-utils-9.15.0/user/shared/drbdmeta_linux.c Examining data/drbd-utils-9.15.0/user/shared/wrap_printf.h Examining data/drbd-utils-9.15.0/user/shared/drbdmeta.h Examining data/drbd-utils-9.15.0/user/shared/shared_parser.h Examining data/drbd-utils-9.15.0/user/shared/drbdmeta_parser.h Examining data/drbd-utils-9.15.0/user/shared/shared_tool.h Examining data/drbd-utils-9.15.0/user/shared/libgenl.c Examining data/drbd-utils-9.15.0/user/shared/libgenl_windrbd.c Examining data/drbd-utils-9.15.0/user/shared/libnla.c Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/sys/prctl.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/types.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/genetlink.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/drbd_config.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/netlink.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/sockios.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/socket.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/major.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/netdevice.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/fs.h Examining data/drbd-utils-9.15.0/user/windrbd-compat-headers/linux/kdev_t.h Examining data/drbd-utils-9.15.0/user/v9/drbdadm_dump.h Examining data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c Examining data/drbd-utils-9.15.0/user/v9/drbdtool_common_windrbd.c Examining data/drbd-utils-9.15.0/user/v9/config_flags.h Examining data/drbd-utils-9.15.0/user/v9/drbdadm_windrbd.c Examining data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c Examining data/drbd-utils-9.15.0/user/v9/drbdsetup_colors.h Examining data/drbd-utils-9.15.0/user/v9/registry.c Examining data/drbd-utils-9.15.0/user/v9/drbd_nla.h Examining data/drbd-utils-9.15.0/user/v9/config_flags.c Examining data/drbd-utils-9.15.0/user/v9/drbdsetup_main.c Examining data/drbd-utils-9.15.0/user/v9/drbdadm_dump.c Examining data/drbd-utils-9.15.0/user/v9/drbdsetup.h Examining data/drbd-utils-9.15.0/user/v9/drbdadm.h Examining data/drbd-utils-9.15.0/user/v9/drbdsetup_windrbd.c Examining data/drbd-utils-9.15.0/user/v9/drbdadm_main.c Examining data/drbd-utils-9.15.0/user/v9/drbdtool_common.c Examining data/drbd-utils-9.15.0/user/v9/drbdsetup_linux.c Examining data/drbd-utils-9.15.0/user/v9/test/drbdsetup_events2_instrumented.c Examining data/drbd-utils-9.15.0/user/v9/drbdsetup.c Examining data/drbd-utils-9.15.0/user/v9/drbd_nla.c Examining data/drbd-utils-9.15.0/user/v9/drbdsetup_colors.c Examining data/drbd-utils-9.15.0/user/v9/drbdadm_linux.c Examining data/drbd-utils-9.15.0/user/v9/drbdadm_parser.h Examining data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c Examining data/drbd-utils-9.15.0/user/v9/drbdtool_common_linux.c Examining data/drbd-utils-9.15.0/user/v9/drbdtool_common.h Examining data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c Examining data/drbd-utils-9.15.0/user/v9/sys_queue.h Examining data/drbd-utils-9.15.0/user/v9/registry.h Examining data/drbd-utils-9.15.0/user/v9/drbdadm_postparse.c Examining data/drbd-utils-9.15.0/user/linux/drbd_config.h FINAL RESULTS: data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c:132:8: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. len = readlink(buf, resolved_path, sizeof(resolved_path)-1); data/drbd-utils-9.15.0/user/v84/registry.c:70:8: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. ret = readlink(path, buf, bufsiz); data/drbd-utils-9.15.0/user/v9/registry.c:70:8: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. ret = readlink(path, buf, bufsiz); data/drbd-utils-9.15.0/drbd-headers/linux/genl_magic_func.h:49:26: [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 pr_info(args...) fprintf(stderr, args); data/drbd-utils-9.15.0/user/drbdmon/CompactDisplay.cpp:1313:32: [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. size_t unsafe_length = vsnprintf(output_buffer, OUTPUT_BUFFER_SIZE, format, vars); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:3807:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0], argv); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4481:2: [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(X64(016)"\n",cfg->md.device_uuid); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4622:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0], argv); data/drbd-utils-9.15.0/user/shared/shared_main.c:197:9: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. while (fscanf data/drbd-utils-9.15.0/user/shared/shared_main.c:327:4: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0], argv); data/drbd-utils-9.15.0/user/shared/shared_tool.c:415: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, data/drbd-utils-9.15.0/user/shared/shared_tool.c:785:2: [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(X64(016)":"X64(016)":", data/drbd-utils-9.15.0/user/shared/shared_tool.c:789: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(X64(016)":", uuid[i]); data/drbd-utils-9.15.0/user/shared/shared_tool.c:904:7: [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. n = vfprintf(stderr, format, ap); data/drbd-utils-9.15.0/user/shared/shared_tool.c:970:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(e, _repl); e += strlen(_repl); break; data/drbd-utils-9.15.0/user/shared/shared_tool.h:34:30: [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 PERROR(fmt, args...) fprintf(stderr, fmt ": %m\n" , ##args); data/drbd-utils-9.15.0/user/shared/wrap_printf.c:7:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))) data/drbd-utils-9.15.0/user/shared/wrap_printf.c:26: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, format, ap1); data/drbd-utils-9.15.0/user/shared/wrap_printf.c:41:6: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. n = vprintf(format, ap2); data/drbd-utils-9.15.0/user/shared/wrap_printf.h:5:24: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))); data/drbd-utils-9.15.0/user/v83/drbdadm.h:191:7: [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). ptr=strcpy(alloca(snprintf(ss_buffer,sizeof(ss_buffer),##__VA_ARGS__)+1),ss_buffer) data/drbd-utils-9.15.0/user/v83/drbdadm.h:191:21: [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. ptr=strcpy(alloca(snprintf(ss_buffer,sizeof(ss_buffer),##__VA_ARGS__)+1),ss_buffer) data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:75:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0],argv); data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:455:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(config_file_dummy,"drbd-proxy-ctl -c '%s'", show_conn); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:63:31: [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 printI(fmt, args... ) printf("%*s" fmt,INDENT_WIDTH * indent,"" , ## args ) data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:883: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(first ? "%s" : " %s", esc(res->name)); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1152:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(*path, X_OK) == 0) { data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2109:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system("exec > /dev/null 2>&1; plymouth quit ; usplash_write QUIT ; " data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2609:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*(c->var) + len_dir, c->name); data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c:52:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s/drbd-minor-%d.conf", DRBD_LIB_DIR, minor); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:285:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buffer,80,"nv="U32,rev->svn_revision); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1605:2: [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( /* connection state */ data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2453:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%s [opts...]", cm->cmd); data/drbd-utils-9.15.0/user/v84/config_flags.c:524:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%s %s:%d", data/drbd-utils-9.15.0/user/v84/drbdadm.h:275:7: [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). ptr=strcpy(alloca(snprintf(ss_buffer,sizeof(ss_buffer),##__VA_ARGS__)+1),ss_buffer) data/drbd-utils-9.15.0/user/v84/drbdadm.h:275:21: [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. ptr=strcpy(alloca(snprintf(ss_buffer,sizeof(ss_buffer),##__VA_ARGS__)+1),ss_buffer) data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:79:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0],argv); data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:663:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(config_file_dummy,"drbdsetup show %s", ctx->res->name); data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:693:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(config_file_dummy,"drbd-proxy-ctl -c '%s'", show_conn); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:69:31: [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 printI(fmt, args... ) printf("%*s" fmt,INDENT_WIDTH * indent,"" , ## args ) data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1033: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(first ? "%s" : " %s", esc(res->name)); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1339:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(*path, X_OK) == 0) { data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2080:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(conn_name, "%s-%s-%s", data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2660:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system("exec > /dev/null 2>&1; plymouth quit ; usplash_write QUIT ; " data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3188:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*(c->var) + len_dir, c->name); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3189: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. if (access(*(c->var), X_OK)) data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3190:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*(c->var), c->name); /* see add_lib_drbd_to_path() */ data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3274:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(opt, "--%s=%s", option->name, optarg); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3276:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(opt, "--%s", option->name); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:300:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(drbdadm_83, argv); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:315:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buffer,80,"nv="U32,rev->svn_revision); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:142:31: [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 printI(fmt, args... ) printf("%*s" fmt,INDENT_WIDTH * indent,"" , ## args ) data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2278:4: [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(X64(016)"\n", ed_uuid); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2329:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",user" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2331:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",no-data" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2333:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",fencing" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2346:8: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ret = vprintf(format, ap); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2521:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",user" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2523:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",peer" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2525:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",dependency" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:3504:37: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (ret && errno == ENOENT && 0 == system("/sbin/modprobe drbd")) { data/drbd-utils-9.15.0/user/v84/drbdsetup.c:3548: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(drbdsetup + len_dir, legacy_drbdsetup); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:3550:2: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(drbdsetup, argv); data/drbd-utils-9.15.0/user/v84/linux/genl_magic_func.h:49:26: [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 pr_info(args...) fprintf(stderr, args); data/drbd-utils-9.15.0/user/v84/registry.c:49:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(linkname, "%s/drbd-minor-%d.conf", DRBD_RUN_DIR, minor); data/drbd-utils-9.15.0/user/v84/registry.c:145:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(linkname, "%s/drbd-resource-%s.conf", DRBD_RUN_DIR, name); data/drbd-utils-9.15.0/user/v9/drbdadm.h:486: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(alloca(snprintf(ss_buffer,sizeof(ss_buffer),##__VA_ARGS__)+1),ss_buffer) data/drbd-utils-9.15.0/user/v9/drbdadm.h:486:16: [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. strcpy(alloca(snprintf(ss_buffer,sizeof(ss_buffer),##__VA_ARGS__)+1),ss_buffer) data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:79:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(argv[0],argv); data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:90:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))) data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:101: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/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:973:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(config_file_dummy, "drbd-proxy-ctl -c '%s'", show_conn); data/drbd-utils-9.15.0/user/v9/drbdadm_dump.c:39:31: [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 printI(fmt, args... ) printf("%*s" fmt,INDENT_WIDTH * indent,"" , ## args ) data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1047:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(*path, X_OK) == 0) { data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1258:7: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. r = fscanf(file, "%" SCNd64, &val); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1671: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. n = snprintf(pos_ ## name, name ## _len, "%s" fmt, \ data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1828:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(conn_name, "%s-%s-%s", data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2520:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system("exec > /dev/null 2>&1; plymouth quit ; usplash_write QUIT ; " data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2846:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*(c->var) + len_dir, c->name); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2847: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. if (access(*(c->var), X_OK)) data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2848:6: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*(c->var), c->name); /* see add_lib_drbd_to_path() */ data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:483:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. p += sprintf(p, "%s | ", map[i]); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:531:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. p += sprintf(p, "%s | ", field->name); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:77:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(drbdadm_83, argv); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:90:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(drbdadm_84, argv); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:104:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buffer,80,"nv="U32,rev->svn_revision); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:106:31: [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 printI(fmt, args... ) printf("%*s" fmt,INDENT_WIDTH * indent,"" , ## args ) data/drbd-utils-9.15.0/user/v9/drbdsetup.c:1345:4: [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(QUOTED("%s"), str); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2363:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",user" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2365:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",no-data" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2367:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",fencing" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2369:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",quorum" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2377:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))) data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2384:8: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. ret = vprintf(format, ap); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2879:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",user" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2881:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",peer" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2883:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buffer, ",dependency" + (*buffer == 0)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3814:4: [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(X64(016)"\n", (uint64_t)device->statistics.dev_exposed_data_uuid); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:4164:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(drbdsetup_83, argv); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:4178:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(drbdsetup_84, argv); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:4338:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(global_ctx.ctx_resource_name, objname); data/drbd-utils-9.15.0/user/v9/drbdsetup.h:117:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))) data/drbd-utils-9.15.0/user/v9/drbdsetup.h:154:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))) data/drbd-utils-9.15.0/user/v9/drbdsetup_linux.c:115:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ret = system("/sbin/modprobe drbd"); data/drbd-utils-9.15.0/user/v9/drbdsetup_windrbd.c:58:17: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(command, args); data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:67:2: [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(X64(016)":"X64(016)":", data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:71: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(X64(016)":", uuid[i]); data/drbd-utils-9.15.0/user/v9/drbdtool_common_linux.c:48:14: [4] (shell) popen: 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. FILE *in = popen("modinfo -F version drbd", "r"); data/drbd-utils-9.15.0/user/v9/registry.c:49:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(linkname, "%s/drbd-minor-%d.conf", DRBD_RUN_DIR, minor); data/drbd-utils-9.15.0/user/v9/registry.c:145:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(linkname, "%s/drbd-resource-%s.conf", DRBD_RUN_DIR, name); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:206:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(t_device, sizeof(t_device) / sizeof(*t_device) -1, L"\\Device\\Drbd%d", minor); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:207:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(t_drive, sizeof(t_drive) / sizeof(*t_drive) -1, L"%s", drive); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:233:10: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(fname, sizeof(fname) / sizeof(fname[0]), L"\\\\?\\Volume{%s}", drive); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:235:10: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(fname, sizeof(fname) / sizeof(fname[0]), L"\\\\.\\%s", drive); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:295:3: [4] (shell) execvp: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execvp(command, args); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:320:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(mount_point, sizeof(mount_point) / sizeof(*mount_point) -1, L"%s\\", drive); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:575:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(t_mountpoint, sizeof(t_mountpoint) / sizeof(*t_mountpoint) -1, L"%s\\", drive); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:594:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(t_mountpoint, sizeof(t_mountpoint) / sizeof(*t_mountpoint) -1, L"%s\\", drive); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:595:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(t_guid, sizeof(t_guid) / sizeof(*t_guid) -1, L"\\\\?\\Volume{%s}\\", guid); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:625:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(t_drive, sizeof(t_drive) / sizeof(*t_drive) -1, L"%s", drive); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1337:2: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(fname, sizeof(fname)/sizeof(fname[0])-1, L"\\\\.\\Drbd%d", minor); data/drbd-utils-9.15.0/user/drbdmon/drbdmon_main.cpp:439:33: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* env_value = getenv(DrbdMon::ENV_COLOR_MODE); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4808:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int c = getopt_long(argc, argv, make_optstring(metaopt), metaopt, 0); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1495:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *peer_address = getenv("DRBD_PEER_ADDRESS"); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1496:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *peer_af = getenv("DRBD_PEER_AF"); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2322:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. path = pp = c = strdup(getenv("PATH")); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2625:7: [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. c = getopt_long(argc, argv, data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2905:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env_drbd_nodename = getenv("__DRBD_NODE__"); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2926:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!getenv("DRBD_DONT_WARN_ON_VERSION_MISMATCH")) data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:575: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("INIT_VERSION")) return; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1121:7: [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. c = getopt_long(argc, argv, make_optstring(lo), lo, 0); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2073:7: [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. c = getopt_long(argc, argv, make_optstring(lo), lo, 0); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2390:13: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if((colstr=getenv("COLUMNS"))) maxcol=atoi(colstr)-1; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2715: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("DRBD_DEBUG_DUMP_ARGV")) data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2717:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. resname = getenv("DRBD_RESOURCE"); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1802:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *peer_address = getenv("DRBD_PEER_ADDRESS"); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1803:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *peer_af = getenv("DRBD_PEER_AF"); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2896:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. path = pp = c = strdup(getenv("PATH")); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3259:7: [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. c = getopt_long(argc, argv, optstring, admopt, &longindex); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3615:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env_drbd_nodename = getenv("__DRBD_NODE__"); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3633:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!getenv("DRBD_DONT_WARN_ON_VERSION_MISMATCH")) data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:2069:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. real_path = realpath(fn, NULL); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:283:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *old_path = getenv("PATH"); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:605: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("INIT_VERSION")) return; data/drbd-utils-9.15.0/user/v84/drbdsetup.c:838:7: [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. c = getopt_long(argc, argv, "(", options, &idx); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:1452:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int c = getopt_long(argc, argv, opts, options, 0); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2680:7: [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. c = getopt_long(argc, argv, make_optstring(cm->options), cm->options, 0); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:3654:7: [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. c = getopt_long(argc, argv, "(", options, &longindex); data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:844:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. fake_drbdsetup_show = getenv("FAKE_DRBDSETUP_SHOW"); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1617:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (!getenv("DRBD_MY_NODE_ID")) data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2918:7: [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. c = getopt_long(argc, argv, optstring, admopt, &longindex); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:3254:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env_drbd_nodename = getenv("__DRBD_NODE__"); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:1832:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. real_path = realpath(fn, NULL); data/drbd-utils-9.15.0/user/v9/drbdadm_postparse.c:1398:26: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. path = pp = c = strdup(getenv("PATH")); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:413: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("INIT_VERSION")) return; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:1042:7: [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. c = getopt_long(argc, argv, "(", options, &idx); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:1792:7: [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. c = getopt_long(argc, argv, opts, options, 0); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2329:7: [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. c = getopt_long(argc, argv, "Dj", show_cmd_options, 0); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3036:7: [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. c = getopt_long(argc, argv, make_optstring(cm->options), cm->options, 0); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:4265:7: [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. c = getopt_long(argc, argv, opts, options, &longindex); data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:239:33: [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. drbd_driver_version_override = getenv("DRBD_DRIVER_VERSION_OVERRIDE"); data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:318:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *old_path = getenv("PATH"); data/drbd-utils-9.15.0/user/v9/test/drbdsetup_events2_instrumented.c:584:7: [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. c = getopt_long(argc, argv, "hTsnc::", options, NULL); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1260:17: [3] (misc) LoadLibrary: Ensure that the full path to the library is specified, or current directory may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to find library path, if you aren't already. if ((Library = LoadLibrary(L"newdev.dll")) == NULL) { data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1371:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "qf")) != -1) { data/drbd-utils-9.15.0/drbd-headers/drbd_meta_data.h:53: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 padding[0] __attribute__((aligned(4096))); data/drbd-utils-9.15.0/drbd-headers/drbd_protocol.h:310: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 verify_alg[0]; data/drbd-utils-9.15.0/drbd-headers/drbd_protocol.h:316: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 verify_alg[SHARED_SECRET_MAX]; data/drbd-utils-9.15.0/drbd-headers/drbd_protocol.h:317: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 csums_alg[SHARED_SECRET_MAX]; data/drbd-utils-9.15.0/drbd-headers/drbd_protocol.h:322: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 verify_alg[SHARED_SECRET_MAX]; data/drbd-utils-9.15.0/drbd-headers/drbd_protocol.h:323: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 csums_alg[SHARED_SECRET_MAX]; data/drbd-utils-9.15.0/drbd-headers/drbd_protocol.h:344: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 integrity_alg[0]; data/drbd-utils-9.15.0/drbd-headers/windrbd/windrbd_ioctl.h:82:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[GENL_NAMSIZ]; data/drbd-utils-9.15.0/drbd-headers/windrbd/windrbd_ioctl.h:156: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/drbd-utils-9.15.0/drbd-headers/windrbd/windrbd_ioctl.h:201:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t mount_point[1]; data/drbd-utils-9.15.0/user/drbdmon/utils.cpp:119:22: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(args[idx], arg_list[idx], arg_length); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:279:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char reserved[8 * 512 - 48]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:473:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char reserved[8 * 512 - (8*(UI_SIZE+3)+4*11)]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:1662: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 valid[MD_AL_MAX_SECT_07]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:1932: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 ppb[10]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2047:18: [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). err = cfg->ops->open(cfg); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2050:20: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). err = cfg->ops->open(cfg); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2707: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). if (cfg->ops->open(cfg)) data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2717: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 ppb[10]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2723: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). if (cfg->ops->open(cfg)) data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2754: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). if (cfg->ops->open(cfg)) { data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2788: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). if (cfg->ops->open(cfg)) data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2815: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 time_str[60]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2830:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 const char *flag_name[32] = { data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2873: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). i = cfg->ops->open(cfg); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:2958: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 flag_buf[80]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:3276: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 slots_seen[DRBD_NODE_ID_MAX] = { 0, }; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:3280: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). yyin = fopen(argv[0],"r"); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:3288:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (cfg->ops->open(cfg) != NO_VALID_MD_FOUND) { data/drbd-utils-9.15.0/user/shared/drbdmeta.c:3763: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_in[200]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:3764: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_err[N_ERR_LINES]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4099:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[160]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4149:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[160]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4313:18: [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). err = cfg->ops->open(cfg); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4401:21: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). virgin = cfg->ops->open(cfg); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4436: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). if (cfg->ops->open(cfg)) data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4460: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). if (cfg->ops->open(cfg)) data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4478: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). if (cfg->ops->open(cfg)) data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4498: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). if (cfg->ops->open(cfg)) data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4596: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 minor_string[7], result[40]; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4647:18: [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). err = cfg->ops->open(cfg); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4702:18: [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). err = cfg->ops->open(cfg); data/drbd-utils-9.15.0/user/shared/drbdmeta.h:142: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). int (*open) (struct format *); data/drbd-utils-9.15.0/user/shared/drbdmeta_linux.c:150:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cfg->md_fd = open(cfg->md_device_name, O_RDWR); data/drbd-utils-9.15.0/user/shared/drbdmeta_linux.c:227:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cfg->md_fd = open(cfg->md_device_name, open_flags ); data/drbd-utils-9.15.0/user/shared/drbdmeta_windrbd.c:182:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char device[1024]; data/drbd-utils-9.15.0/user/shared/libgenl.h:82: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 data[0]; data/drbd-utils-9.15.0/user/shared/libgenl.h:936: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[GENL_NAMSIZ]; data/drbd-utils-9.15.0/user/shared/libgenl.h:955: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[GENL_NAMSIZ]; data/drbd-utils-9.15.0/user/shared/libnla.c:259: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(dst, src, len); data/drbd-utils-9.15.0/user/shared/libnla.c:280: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(dest, nla_data(src), minlen); data/drbd-utils-9.15.0/user/shared/libnla.c:417: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(nla_data(nla), data, attrlen); data/drbd-utils-9.15.0/user/shared/libnla.c:434: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(start, data, attrlen); data/drbd-utils-9.15.0/user/shared/libnla.c:555: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(nla_data(nla), data, attrlen); data/drbd-utils-9.15.0/user/shared/libnla.c:617: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(msg_put(msg, attrlen), data, attrlen); data/drbd-utils-9.15.0/user/shared/shared_main.c:174:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp_ip[INET6_ADDRSTRLEN+1]; data/drbd-utils-9.15.0/user/shared/shared_main.c:175: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[20]; /* IFNAMSIZ aka IF_NAMESIZE is 16 */ data/drbd-utils-9.15.0/user/shared/shared_main.c:189: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). if_inet6 = fopen(PROC_IF_INET6, "r"); data/drbd-utils-9.15.0/user/shared/shared_main.h: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 ifi_name[IFNAMSIZ]; /* interface name, nul terminated */ data/drbd-utils-9.15.0/user/shared/shared_tool.c:48:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1024]; data/drbd-utils-9.15.0/user/shared/shared_tool.c:111:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "%u %cB", (unsigned)size, units[base]); data/drbd-utils-9.15.0/user/shared/shared_tool.c:118:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[200]; data/drbd-utils-9.15.0/user/shared/shared_tool.c:119: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 seen[256]; data/drbd-utils-9.15.0/user/shared/shared_tool.c:253:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path, "w"); data/drbd-utils-9.15.0/user/shared/shared_tool.c:302: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 nl[2]; data/drbd-utils-9.15.0/user/shared/shared_tool.c:309:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path, "r"); data/drbd-utils-9.15.0/user/shared/shared_tool.c:347:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/urandom", O_RDONLY); data/drbd-utils-9.15.0/user/shared/shared_tool.c:606:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(path, O_RDWR | O_CREAT, 0600)) < 0) { data/drbd-utils-9.15.0/user/shared/shared_tool.c:924:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1024]; data/drbd-utils-9.15.0/user/shared/shared_tool.c:957:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1024]; data/drbd-utils-9.15.0/user/shared/shared_windrbd.c:67:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char drbd_version[256] = "Unknown DRBD version (driver not loaded, do drbdadm status to load it)"; data/drbd-utils-9.15.0/user/shared/shared_windrbd.c:68:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char windrbd_version[256] = "Unknown WinDRBD version (driver not loaded, do drbdadm status to load it)"; data/drbd-utils-9.15.0/user/v83/drbdadm.h:166:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char ss_buffer[1024]; data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:58:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dev_null = open("/dev/null", O_WRONLY); data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:213: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 *argv[4] = { drbd_proxy_ctl, "-c", (char*)cmd, NULL }; data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:223:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int _is_plugin_in_list(char *string, data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:224:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char slist[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:225: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 alist[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:266: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 *plugin_changes[MAX_PLUGINS], *cp, *conn_name; data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:269: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 p_res[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:417:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char config_file_dummy[250], *conn_name, show_conn[128]; data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:426:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(config_file_dummy,"drbdsetup %u show", res->me->device_minor); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:166:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ss_buffer[1024]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:197:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *setup_opts[10]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:384:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1189: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1225:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1267: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1304: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1431:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4096]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1488: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 minor_string[8]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1553:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1641:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char conn_name[128]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1660:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[4] = { drbd_proxy_ctl, "-c", NULL, NULL }; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1683: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1725: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 *argv[4] = { drbd_proxy_ctl, "-c", NULL, NULL}; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1800: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1839: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2025: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 *argv[20], answer[40]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2047:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/console", O_RDONLY); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2051:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/console", O_WRONLY); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2317: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 abs_path[100]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2541:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cwd_fd = open(".", O_RDONLY | O_CLOEXEC); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2649: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). yyin = fopen(optarg, "r"); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2667: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 *pathes[2]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2675: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 *pathes[2]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2683: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 *pathes[2]; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2792: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). yyin = fopen(f, "r"); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2806: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). yyin = fopen(conf_file[i], "r"); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:3004: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). yyin = fopen(config_test, "r"); data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c:57: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[255]; data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c:76:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[255]; data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c:114:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[255]; data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c:115:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char resolved_path[MAX_REGISTER_PATH_LEN+1]; data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:483:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char tmp[2] = "\0"; data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:544:33: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). global_options.minor_count = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:550:36: [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). global_options.dialog_refresh = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:705: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 errstr[20]; data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:727:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(errstr, "TK_STRING | '%c'", delimeter); data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:856: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). *minor = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:1640: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). cwd_fd = open(".", O_RDONLY | O_CLOEXEC); data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:1659: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). f = fopen(glob_buf.gl_pathv[i], "re"); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c: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 git_hash[GIT_HASH_BYTE]; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:83: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("/proc/drbd",O_RDONLY); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.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 token[80]; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:172:24: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). rel->svn_revision = atol(token) * 10; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:282:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[80]; // Not generic, sufficient for the purpose. data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:290:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. p = sprintf(buffer,"git="); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:292:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. while(len--) p += sprintf(buffer+p,"%02x",*bytes++); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:303: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(NODE_ID_FILE,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:306: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(NODE_ID_FILE,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:324: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(on_disk.ni.rev.git_hash,ni->rev.git_hash,GIT_HASH_BYTE); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:343: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(NODE_ID_FILE, O_RDONLY); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:363: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(ni->rev.git_hash, on_disk.ni.rev.git_hash, GIT_HASH_BYTE); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:408: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[2048]; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:455:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[buf_len]; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:474:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *)&server.sin_addr, &addr, sizeof(addr)); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:480: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((char *)&server.sin_addr, host_info->h_addr, data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.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 answer[ANSWER_SIZE]; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:564: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 n_comment[ANSWER_SIZE*3]; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:698: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 answer[ANSWER_SIZE]; data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:718: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(res->me->disk,O_RDONLY); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:601: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(tl->tag_list_cpos, data, data_len); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:616:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((device_fd = open(arg,O_RDWR))==-1) { data/drbd-utils-9.15.0/user/v83/drbdsetup.c:670: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(addr, tmp->ai_addr, sizeof(*addr)); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:675: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 ip[INET6_ADDRSTRLEN]; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:839:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16]; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:846: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(PROC_NET_AF_SSOCKS_FAMILY, O_RDONLY); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:849: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(PROC_NET_AF_SCI_FAMILY, O_RDONLY); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1089:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[ RCV_SIZE ]; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1375:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[ 4096 ]; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1455:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[INET6_ADDRSTRLEN]; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1459: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(&a.addr, address, addr_len); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1563: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(backing_dev, O_RDONLY); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:1770: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(uuids, tl_uuids, len); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2364:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char line[300]; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2390:40: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if((colstr=getenv("COLUMNS"))) maxcol=atoi(colstr)-1; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2426:27: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. startcol=prevcol=col = sprintf(line," "); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2450: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 line[41]; data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2655:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cn_idx_file = fopen("/sys/module/drbd/parameters/cn_idx", "r"); data/drbd-utils-9.15.0/user/v83/linux/drbd_tag_magic.h:29: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 member[len]; int member ## _len; \ data/drbd-utils-9.15.0/user/v84/config_flags.c:187:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1 + 20 + 2]; data/drbd-utils-9.15.0/user/v84/config_flags.c:454:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16]; data/drbd-utils-9.15.0/user/v84/config_flags.c:461: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(PROC_NET_AF_SSOCKS_FAMILY, O_RDONLY); data/drbd-utils-9.15.0/user/v84/config_flags.c:464: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(PROC_NET_AF_SCI_FAMILY, O_RDONLY); data/drbd-utils-9.15.0/user/v84/config_flags.c:519: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(&a.addr, address, addr_len); data/drbd-utils-9.15.0/user/v84/config_flags.c:529: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 buf2[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v84/config_flags.c:540:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer, "[unknown af=%d, len=%d]", a.addr.sa_family, addr_len); data/drbd-utils-9.15.0/user/v84/config_flags.c:546:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v84/config_flags.c:571: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(addr, tmp->ai_addr, sizeof(*addr)); data/drbd-utils-9.15.0/user/v84/config_flags.c:576: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 ip[INET6_ADDRSTRLEN]; data/drbd-utils-9.15.0/user/v84/drbdadm.h:246:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char ss_buffer[1024]; data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:62:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dev_null = open("/dev/null", O_WRONLY); data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:253:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[4] = { drbd_proxy_ctl, "-c", (char*)ctx->arg, NULL }; data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:263:24: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. int _is_plugin_in_list(char *string, data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:264: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 slist[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:265: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 alist[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:306:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *plugin_changes[MAX_PLUGINS], *cp, *conn_name; data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:309: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 p_res[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:652: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 config_file_dummy[250]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:178:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ss_buffer[1024]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1391: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1463: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1481: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1518: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1562: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1596: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1735:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4096]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1794: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 minor_string[8]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1795: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 volume_string[8]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1918: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1968: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2090: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 *argv[4] = { drbd_proxy_ctl, "-c", NULL, NULL }; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2114: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2158: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 *argv[4] = { drbd_proxy_ctl, "-c", NULL, NULL}; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2256: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2532: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 *argv[20], answer[40]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2554:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/console", O_RDONLY); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2560:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/console", O_WRONLY); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2891: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 abs_path[100]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3119:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cwd_fd = open(".", O_RDONLY | O_CLOEXEC); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3230: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(admopt, general_admopt, (n + 1) * sizeof(*admopt)); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3233: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(&admopt[n+1], &admopt[n], sizeof(*admopt)); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3298: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). yyin = fopen(optarg, "r"); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3314: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 *pathes[2]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3322: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 *pathes[2]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3330: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 *pathes[2]; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3511: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). yyin = fopen(f, "r"); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3523: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). yyin = fopen(conf_file[i], "r"); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3692: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). yyin = fopen(config_test, "r"); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:468:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char tmp[2] = "\0"; data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:528:33: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). global_options.minor_count = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:534:36: [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). global_options.dialog_refresh = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:539:39: [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). global_options.cmd_timeout_short = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:544:40: [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). global_options.cmd_timeout_medium = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:549:38: [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). global_options.cmd_timeout_long = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:812: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 errstr[20]; data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:834:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(errstr, "TK_STRING | '%c'", delimeter); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:974:23: [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). vol->device_minor = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:1350:26: [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). parse_volume(atoi(yylval.txt), on_hosts), data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:1462:70: [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). host->volumes = INSERT_SORTED(host->volumes, parse_stacked_volume(atoi(yylval.txt)), vnr); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:1980:25: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). parse_volume(atoi(yylval.txt), NULL), data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:2110: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). cwd_fd = open(".", O_RDONLY | O_CLOEXEC); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:2132: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). f = fopen(glob_buf.gl_pathv[i], "re"); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c: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 git_hash[GIT_HASH_BYTE]; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:83: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("/proc/drbd",O_RDONLY); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.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 token[80]; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:172:24: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). rel->svn_revision = atol(token) * 10; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:312:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[80]; // Not generic, sufficient for the purpose. data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:320:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. p = sprintf(buffer,"git="); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:322:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. while(len--) p += sprintf(buffer+p,"%02x",*bytes++); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:333: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(NODE_ID_FILE,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:336: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(NODE_ID_FILE,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:354: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(on_disk.ni.rev.git_hash,ni->rev.git_hash,GIT_HASH_BYTE); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:373: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(NODE_ID_FILE, O_RDONLY); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:393: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(ni->rev.git_hash, on_disk.ni.rev.git_hash, GIT_HASH_BYTE); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:438: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[2048]; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:485:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[buf_len]; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:504: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 *)&server.sin_addr, &addr, sizeof(addr)); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:510: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((char *)&server.sin_addr, host_info->h_addr, data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:593: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 answer[ANSWER_SIZE]; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:594: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 n_comment[ANSWER_SIZE*3]; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:732: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 answer[ANSWER_SIZE]; data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:754: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(ctx->vol->disk,O_RDONLY); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:558:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((device_fd = open(arg,O_RDWR))==-1) { data/drbd-utils-9.15.0/user/v84/drbdsetup.c:1559:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v84/drbdsetup.c:1638: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(r->res_opts, res_opts, size); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:1797:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(c->net_conf, net_conf, size); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:1949:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char last_ctx_resource_name[128]; data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2059: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(dc.backing_dev, O_RDONLY); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2325:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[32]; data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2335:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buffer, "no"); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2517:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[64]; data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2527:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buffer, "no"); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:2842: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((*found)->data, value, size); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:3461:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[300]; data/drbd-utils-9.15.0/user/v84/registry.c:54: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v84/registry.c:83: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 target[PATH_MAX]; data/drbd-utils-9.15.0/user/v84/registry.c: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v84/registry.c:122:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char target[PATH_MAX]; data/drbd-utils-9.15.0/user/v84/registry.c:131:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v84/registry.c:150: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v84/registry.c:164: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v84/registry.c:175:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/config_flags.c:214:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1 + 20 + 2]; data/drbd-utils-9.15.0/user/v9/config_flags.c:389:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1 + 10 + 2]; data/drbd-utils-9.15.0/user/v9/drbdadm.h:465:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. extern char ss_buffer[1024]; data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:62:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dev_null = open("/dev/null", O_WRONLY); data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:310: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 *argv[4] = { drbd_proxy_ctl, "-c", (char*)ctx->cmd->name, NULL }; data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:335:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. bool _is_plugin_in_list(char *string, data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:336: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 slist[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:337: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 alist[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:380: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 *plugin_changes[MAX_PLUGINS], *cp, *conn_name; data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:383: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 p_res[MAX_PLUGINS][MAX_PLUGIN_NAME], data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:861: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). yyin = fopen(fake_drbdsetup_show, "r"); data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:924: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 config_file_dummy[250]; data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:958: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 *argv[20]; data/drbd-utils-9.15.0/user/v9/drbdadm_linux.c:95:23: [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). vol->device_minor = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:139:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ss_buffer[1024]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1130: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1200: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1225:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1256: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). file = fopen(path, "r"); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1270: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1359: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1399: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1454:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4096]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1600: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 key[sizeof("DRBD_NODE_ID_32")]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1627: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 minor_string[8]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1628: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 volume_string[8]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1629: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 *argv[4] = { NULL, }; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1714: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1744: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1763: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1793: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1837: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 *argv[4] = { drbd_proxy_ctl, "-c", NULL, NULL }; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1866: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1907: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 *argv[4] = { drbd_proxy_ctl, "-c", NULL, NULL}; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2040: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 *argv[MAX_ARGS]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2397: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 *argv[20], answer[40]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2418:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/console", O_RDONLY); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2424:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/console", O_WRONLY); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2745: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). cwd_fd = open(".", O_RDONLY | O_CLOEXEC); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2888: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(admopt, general_admopt, (n + 1) * sizeof(*admopt)); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2891: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(&admopt[n+1], &admopt[n], sizeof(*admopt)); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2952: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). yyin = fopen(optarg, "r"); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2972: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 *pathes[2]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2980: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 *pathes[2]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2988: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 *pathes[2]; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:3163: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). yyin = fopen(f, "r"); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:3175: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). yyin = fopen(conf_file[i], "r"); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:3330: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). yyin = fopen(config_test, "r"); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:369:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char tmp[2] = "\0"; data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:401:33: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). global_options.minor_count = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:407:36: [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). global_options.dialog_refresh = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:412:39: [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). global_options.cmd_timeout_short = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:417:40: [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). global_options.cmd_timeout_medium = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:422:38: [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). global_options.cmd_timeout_long = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:734: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 errstr[20]; data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:754:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(errstr, "TK_STRING | '%c'", delimeter); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:1102:47: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). insert_volume(&host->volumes, parse_volume(atoi(yylval.txt), on_hosts)); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:1196:55: [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). insert_volume(&host->volumes, parse_stacked_volume(atoi(yylval.txt))); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:1600:36: [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). peer_device = parse_peer_device(atoi(yylval.txt)); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:1777:46: [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). insert_volume(&res->volumes, parse_volume(atoi(yylval.txt), NULL)); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:1907: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(file_name, "re"); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:1947: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). f = fopen(glob_buf.gl_pathv[i], "re"); data/drbd-utils-9.15.0/user/v9/drbdadm_postparse.c:1393: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 abs_path[100]; data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:101:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[80]; // Not generic, sufficient for the purpose. data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:109:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. p = sprintf(buffer,"git="); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:111:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. while(len--) p += sprintf(buffer+p,"%02x",*bytes++); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:122: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(NODE_ID_FILE,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:125: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(NODE_ID_FILE,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:143: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(on_disk.ni.rev.git_hash,ni->rev.git_hash,GIT_HASH_BYTE); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:162: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(NODE_ID_FILE, O_RDONLY); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:182: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(ni->rev.git_hash, on_disk.ni.rev.git_hash, GIT_HASH_BYTE); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:228: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[2048]; data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:280:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[buf_len]; data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:300: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 *)&server.sin_addr, &addr, sizeof(addr)); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:306: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((char *)&server.sin_addr, host_info->h_addr, data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:400:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char answer[ANSWER_SIZE]; data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:401: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 n_comment[ANSWER_SIZE*3]; data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:560: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 answer[ANSWER_SIZE]; data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:617: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(ctx->vol->disk,O_RDONLY); data/drbd-utils-9.15.0/user/v9/drbdadm_windrbd.c:50:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *argv[40]; data/drbd-utils-9.15.0/user/v9/drbdadm_windrbd.c:81: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. char minor_str[10]; data/drbd-utils-9.15.0/user/v9/drbdadm_windrbd.c:149:23: [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). vol->device_minor = atoi(yylval.txt); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:620: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(addr, tmp->ai_addr, sizeof(*addr)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:625: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 ip[INET6_ADDRSTRLEN]; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:772:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[16]; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:779: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(PROC_NET_AF_SSOCKS_FAMILY, O_RDONLY); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:782: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(PROC_NET_AF_SCI_FAMILY, O_RDONLY); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:1107: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[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:1992: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 address[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2359:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[32]; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2372:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buffer, "no"); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2875:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[64]; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:2885:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buffer, "no"); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3243: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(&a.addr, address, addr_len); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3253: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 buf2[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3286: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(r->res_opts, res_opts, size); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3400: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(d->disk_conf_nl, disk_conf_nl, size); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3490: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(c->net_conf, net_conf, size); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3495: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(c->path_list, path_list, size); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3616: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->peer_device_conf, peer_device_conf, size); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:3742: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(device->disk_conf.backing_dev, O_RDONLY); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:4124:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[300]; data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:370: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_nla, old_nla, size); data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:673: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 my_addr[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:674: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 peer_addr[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:765: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 my_addr[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:766: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 peer_addr[ADDRESS_STR_MAX]; data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:842: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 my_addr[ADDRESS_STR_MAX] = ""; data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:843: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 peer_addr[ADDRESS_STR_MAX] = ""; data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:891: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(entry->nlh, info->nlhdr, info->nlhdr->nlmsg_len); data/drbd-utils-9.15.0/user/v9/drbdsetup_events2.c:906: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 timestamp_prefix[TIMESTAMP_LEN]; data/drbd-utils-9.15.0/user/v9/drbdsetup_linux.c:44:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((device_fd = open(arg,O_RDWR))==-1) { data/drbd-utils-9.15.0/user/v9/drbdsetup_windrbd.c:23:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char device[1024]; data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:123: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 hostname[HOST_NAME_MAX]; data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:183: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 token[80]; data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:213:24: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). rel->svn_revision = atol(token) * 10; data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:275:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/drbd-utils-9.15.0/user/v9/drbdtool_common.h: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 git_hash[GIT_HASH_BYTE]; data/drbd-utils-9.15.0/user/v9/drbdtool_common_linux.c:16: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("/proc/drbd",O_RDONLY); data/drbd-utils-9.15.0/user/v9/drbdtool_common_linux.c:50:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/drbd-utils-9.15.0/user/v9/registry.c:54: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/registry.c:83: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 target[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/registry.c: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/registry.c:122:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char target[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/registry.c:131:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/registry.c:150: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/registry.c:164: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 linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/registry.c:175:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char linkname[PATH_MAX]; data/drbd-utils-9.15.0/user/v9/test/drbdsetup_events2_instrumented.c:529:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char input[MAX_INPUT_LENGTH]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:189:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t t_device[100], t_drive[100]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:231:9: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t fname[100]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:313:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t mount_point[10]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:314:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t guid[80]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:315: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 guid_ascii[80]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:317:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *args[4]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:360:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char x[10]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:407:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:540:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(log_file, O_WRONLY | O_CREAT | O_SYNC | O_APPEND, 0664)) < 0) data/drbd-utils-9.15.0/user/windrbd/windrbd.c:545:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[512]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:546: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 dosbuf[1024]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:570:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t t_mountpoint[100]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:588:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t t_mountpoint[100]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:589:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t t_guid[100]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:612:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t t_drive[100]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:902: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). int fd = open("/proc/self/exename", O_RDONLY); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:928:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4096]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:951:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char drbdadm_path[4096]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:971:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(p, "drbdadm"); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:974:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(drbdadm_path, "/cygdrive/c/windrbd/usr/sbin/drbdadm"); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1082:12: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). wcchars = MultiByteToWideChar(CP_UTF8, 0, mount_point, -1, NULL, 0); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1090:13: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). wcchars2 = MultiByteToWideChar(CP_UTF8, 0, mount_point, -1, &mmp->mount_point[0], wcchars); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1183:2: [2] (buffer) TCHAR: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. TCHAR buf[1024]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1243:2: [2] (buffer) TCHAR: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. TCHAR ClassName[MAX_CLASS_NAME]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1247:2: [2] (buffer) TCHAR: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. TCHAR FullFilePath[1024]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1248:2: [2] (buffer) TCHAR: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. TCHAR InfFile[1024]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1334:2: [2] (buffer) wchar_t: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. wchar_t fname[256]; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1387:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int minor = atoi(argv[optind+1]); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1396:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int minor = atoi(argv[optind+1]); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1470:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int after = atoi(argv[optind+1]); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1487:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int minor = atoi(argv[optind+1]); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1514:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int minor = atoi(argv[optind+1]); data/drbd-utils-9.15.0/user/drbdmon/CompactDisplay.cpp:1297:26: [1] (buffer) strlen: Does not handle 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 length = std::strlen(text); data/drbd-utils-9.15.0/user/drbdmon/CompactDisplay.cpp:1486: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). sync_blk_width = std::strlen(UTF8_SYNC_BLK); data/drbd-utils-9.15.0/user/drbdmon/CompactDisplay.cpp:1487: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). unsync_blk_width = std::strlen(UTF8_UNSYNC_BLK); data/drbd-utils-9.15.0/user/drbdmon/DrbdMon.cpp:294:46: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_count = read(STDIN_FILENO, &c, 1); data/drbd-utils-9.15.0/user/drbdmon/EventsIo.cpp:230:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_size = read(sig_fd, signal_buffer.get(), sizeof (struct signalfd_siginfo)); data/drbd-utils-9.15.0/user/drbdmon/EventsIo.cpp:294:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_count = read(events_fd, &(events_buffer[events_length]), length); data/drbd-utils-9.15.0/user/drbdmon/EventsIo.cpp:328:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_count = read(error_fd, &(error_buffer[0]), ERROR_BUFFER_SIZE); data/drbd-utils-9.15.0/user/drbdmon/drbdmon_main.cpp:196:32: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int key = std::fgetc(stdin); data/drbd-utils-9.15.0/user/drbdmon/utils.cpp:117: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). size_t arg_length = std::strlen(arg_list[idx]) + 1; data/drbd-utils-9.15.0/user/shared/drbdmeta.c:987:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(t)) { data/drbd-utils-9.15.0/user/shared/drbdmeta.c:1019:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(t)) { data/drbd-utils-9.15.0/user/shared/drbdmeta.c:3834:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = read(pipes[1][0], buf_in, sizeof(buf_in)-1); data/drbd-utils-9.15.0/user/shared/drbdmeta.c:4579: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/drbd-utils-9.15.0/user/shared/drbdmeta.c:4628:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(pipes[0], result, ARRAY_SIZE(result)); data/drbd-utils-9.15.0/user/shared/libgenl.c:284: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). BUG_ON(!strlen(family->name)); data/drbd-utils-9.15.0/user/shared/libgenl.h:715:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return nla_put(msg, attrtype, strlen(str) + 1, str); data/drbd-utils-9.15.0/user/shared/libgenl.h:765:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). NLA_PUT(msg, attrtype, strlen(value) + 1, value) data/drbd-utils-9.15.0/user/shared/libgenl_windrbd.c:85:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(m.name, name, sizeof(m.name)); data/drbd-utils-9.15.0/user/shared/libgenl_windrbd.c:178:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(BUSY_POLLING_INTERVAL_MS * 1000); data/drbd-utils-9.15.0/user/shared/libnla.c:309: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) + 1; data/drbd-utils-9.15.0/user/shared/shared_main.c:244:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100 * 1000); data/drbd-utils-9.15.0/user/shared/shared_tool.c:164:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(stream); data/drbd-utils-9.15.0/user/shared/shared_tool.c:170:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getc(stream); data/drbd-utils-9.15.0/user/shared/shared_tool.c:353:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buffer, len) != len) { data/drbd-utils-9.15.0/user/shared/shared_tool.c:930: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). if (0 == fnmatch("*[!a-zA-Z0-9/._-]*", str, 0) || strlen(str) > 80) { data/drbd-utils-9.15.0/user/shared/shared_tool.c:969: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). if (e - buffer >= sizeof(buffer)-1-strlen(_repl)) goto too_long; \ data/drbd-utils-9.15.0/user/shared/shared_tool.c:970:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strcpy(e, _repl); e += strlen(_repl); break; data/drbd-utils-9.15.0/user/shared/shared_windrbd.c:20: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). return i == strlen(GUID_MASK) && arg[i] == '\0'; data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:135:6: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. int equal; data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:145:11: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. equal = equal && data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:150:11: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. equal = equal && conf->peer && data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:155:9: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return equal; data/drbd-utils-9.15.0/user/v83/drbdadm_adjust.c:242:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(copy, string, word_len); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:406:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, buf + s, sizeof(buf) - s); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:416: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). if (s == 0 || strncmp(buf, "Unconfigured", strlen("Unconfigured")) == 0) data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1444:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, buffer + s, 4096 - s); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:1978:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fileno(stdin), s, size - 1); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2605: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). l = len_dir + strlen(c->name) + 1; data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2608:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*(c->var), argv[0], len_dir); data/drbd-utils-9.15.0/user/v83/drbdadm_main.c:2907:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(nodeinfo.nodename, env_drbd_nodename, data/drbd-utils-9.15.0/user/v83/drbdadm_minor_table.c:92: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). else if (strlen(path) >= MAX_REGISTER_PATH_LEN) data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:457: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(s) > 20 ? "..." : ""); data/drbd-utils-9.15.0/user/v83/drbdadm_parser.c:491:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tmp[0] ? tmp : exp, s, strlen(s) > 20 ? "..." : "", got); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:89:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, buffer, SLURP_SIZE-1); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:177: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). read_hex(rel->git_hash, token, GIT_HASH_BYTE, strlen(token)); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:182:69: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). read_hex(rel->git_hash + SRCVERSION_PAD, token, SRCVERSION_BYTE, strlen(token)); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:348:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, &on_disk, sizeof(on_disk)); data/drbd-utils-9.15.0/user/v83/drbdadm_usage_cnt.c:682:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(pipes[0], buffer, SLURP_SIZE-1); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:166:73: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int numeric_opt_usage(struct drbd_option *option, char* str, int strlen); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:167:73: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int handler_opt_usage(struct drbd_option *option, char* str, int strlen); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:168:69: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int bit_opt_usage(struct drbd_option *option, char* str, int strlen); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:169:72: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int string_opt_usage(struct drbd_option *option, char* str, int strlen); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:633:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). add_tag(tl,ad->tag,arg,strlen(arg)+1); // include the null byte. data/drbd-utils-9.15.0/user/v83/drbdsetup.c:738:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp(text, afs[i].text, strlen(afs[i].text))) { data/drbd-utils-9.15.0/user/v83/drbdsetup.c:740:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *address = text + strlen(afs[i].text); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:860:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = read(fd, buf, sizeof(buf)-1); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:950:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). add_tag(tl,od->tag,arg,strlen(arg)+1); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2274:73: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int numeric_opt_usage(struct drbd_option *option, char* str, int strlen) data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2276:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return snprintf(str,strlen," [{--%s|-%c} %lld ... %lld]", data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2282:73: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int handler_opt_usage(struct drbd_option *option, char* str, int strlen) data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2287: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). chars += snprintf(str,strlen," [{--%s|-%c} {", data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2292: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). if(!first) chars += snprintf(str+chars,strlen,"|"); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2294: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). chars += snprintf(str+chars,strlen, data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2298:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). chars += snprintf(str+chars,strlen,"}]"); data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2302:69: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int bit_opt_usage(struct drbd_option *option, char* str, int strlen) data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2304:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return snprintf(str,strlen," [{--%s|-%c}]", data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2308:72: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). static int string_opt_usage(struct drbd_option *option, char* str, int strlen) data/drbd-utils-9.15.0/user/v83/drbdsetup.c:2310:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return snprintf(str,strlen," [{--%s|-%c} <str>]", data/drbd-utils-9.15.0/user/v84/config_flags.c:475:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = read(fd, buf, sizeof(buf)-1); data/drbd-utils-9.15.0/user/v84/config_flags.c:638:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp(*address, afs[i].text, strlen(afs[i].text))) { data/drbd-utils-9.15.0/user/v84/config_flags.c:640: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). *address += strlen(afs[i].text); data/drbd-utils-9.15.0/user/v84/drbdadm_adjust.c:281:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(copy, string, word_len); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:1748:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, buffer + s, 4096 - s); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2072: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(res->name) + data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2073: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(names_to_str_c(res->peer->proxy->on_hosts, '_')) + data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2074: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(names_to_str_c(res->me->proxy->on_hosts, '_')) + data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:2481:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fileno(stdin), s, size - 1); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3184: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). l = len_dir + strlen(c->name) + 1; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3187:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*(c->var), argv[0], len_dir); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3269:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(option->name) + 2; data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3271: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). len += 1 + strlen(optarg); data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3437: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 (strlen(field->name) == len - 2 && data/drbd-utils-9.15.0/user/v84/drbdadm_main.c:3617:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(nodeinfo.nodename, env_drbd_nodename, data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:442: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). config_file, line, exp, s, strlen(s) > 20 ? "..." : ""); data/drbd-utils-9.15.0/user/v84/drbdadm_parser.c:474:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). config_file, line, tmp[0] ? tmp : exp, s, strlen(s) > 20 ? "..." : "", got); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:89:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, buffer, SLURP_SIZE-1); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:177: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). read_hex(rel->git_hash, token, GIT_HASH_BYTE, strlen(token)); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:182:69: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). read_hex(rel->git_hash + SRCVERSION_PAD, token, SRCVERSION_BYTE, strlen(token)); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:378:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, &on_disk, sizeof(on_disk)); data/drbd-utils-9.15.0/user/v84/drbdadm_usage_cnt.c:716:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(pipes[0], buffer, SLURP_SIZE-1); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:1983:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(last_ctx_resource_name, cfg.ctx_resource_name, sizeof(last_ctx_resource_name)); data/drbd-utils-9.15.0/user/v84/drbdsetup.c:3541: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). l = len_dir + strlen(legacy_drbdsetup) + 1; data/drbd-utils-9.15.0/user/v84/drbdsetup.c:3547:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(drbdsetup, argv[0], len_dir); data/drbd-utils-9.15.0/user/v84/registry.c:92:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp(path, DRBD_RUN_DIR "/", strlen(DRBD_RUN_DIR "/"))) data/drbd-utils-9.15.0/user/v9/config_flags.c:650:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(value) >= field->u.s.max_len) data/drbd-utils-9.15.0/user/v9/drbdadm_adjust.c:353:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(copy, string, word_len); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1073:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!context_def || strlen(name) <= 2) data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1104: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). if (!strncmp(OPT->name, b_opt->name+2, strlen(OPT->name))) { \ data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1348:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1470:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, buffer + s, 4096 - s); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1655: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). ll_len += strlen(shell_escape(vol->disk ?: "none")) + 1; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1819: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). return (conn->name ? strlen(conn->name) : strlen(res->name)) + data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1819: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 (conn->name ? strlen(conn->name) : strlen(res->name)) + data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1820: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(names_to_str_c(&path->peer_proxy->on_hosts, '_')) + data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:1821: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(names_to_str_c(&path->my_proxy->on_hosts, '_')) + data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2349:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fileno(stdin), s, size - 1); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2842: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). l = len_dir + strlen(c->name) + 1; data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:2845:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*(c->var), argv[0], len_dir); data/drbd-utils-9.15.0/user/v9/drbdadm_main.c:3089:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(field->name) == len - 2 && data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:343: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). config_file, line, exp, s, strlen(s) > 20 ? "..." : ""); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:375:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). config_file, line, tmp[0] ? tmp : exp, s, strlen(s) > 20 ? "..." : "", got); data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:474: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). size += strlen(map[i]) + 3; data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:503: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). value, strlen(value) > 20 ? "..." : "", data/drbd-utils-9.15.0/user/v9/drbdadm_parser.c:524: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). size += strlen(field->name) + 3; data/drbd-utils-9.15.0/user/v9/drbdadm_postparse.c:181: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(host_info->address.addr)); data/drbd-utils-9.15.0/user/v9/drbdadm_postparse.c:259: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(ha->proxy->outside.addr)); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:167:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, &on_disk, sizeof(on_disk)); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:520:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(pipes[0], buffer, SLURP_SIZE-1); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:537:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const int str_len = strlen(opt_name); data/drbd-utils-9.15.0/user/v9/drbdadm_usage_cnt.c:574: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). max_peers_str = ssprintf("%s", b_opt_max_peers->name + strlen(opt_max_peers)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:687:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp(*address, afs[i].text, strlen(afs[i].text))) { data/drbd-utils-9.15.0/user/v9/drbdsetup.c:689: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). *address += strlen(afs[i].text); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:793:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = read(fd, buf, sizeof(buf)-1); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:1929:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (c = fgetc(stdin)) != EOF) { data/drbd-utils-9.15.0/user/v9/drbdsetup.c:4335: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). assert(strlen(objname) < sizeof(global_ctx.ctx_resource_name)); data/drbd-utils-9.15.0/user/v9/drbdsetup.c:4337: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). global_ctx.ctx_resource_name_len = strlen(objname); data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:219: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). read_hex(rel->git_hash, token, GIT_HASH_BYTE, strlen(token)); data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:224:69: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). read_hex(rel->git_hash + SRCVERSION_PAD, token, SRCVERSION_BYTE, strlen(token)); data/drbd-utils-9.15.0/user/v9/drbdtool_common.c:326: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). old_path[strlen(old_path) -1] != ':') data/drbd-utils-9.15.0/user/v9/drbdtool_common_linux.c:24:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rr = read(fd, buffer, SLURP_SIZE-1); data/drbd-utils-9.15.0/user/v9/drbdtool_common_linux.c:51:12: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. int c = fscanf(in, "%30s", buf); data/drbd-utils-9.15.0/user/v9/registry.c:92:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strncmp(path, DRBD_RUN_DIR "/", strlen(DRBD_RUN_DIR "/"))) data/drbd-utils-9.15.0/user/windrbd/windrbd.c:911:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, buf, bufsize-1); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1047:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(USER_MODE_HELPER_POLLING_INTERVAL_MS*1000); data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1151: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(parameter)+1; data/drbd-utils-9.15.0/user/windrbd/windrbd.c:1252:13: [1] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). Risk is very low, the length appears to be in characters not bytes. if ((ret = MultiByteToWideChar(CP_UTF8, 0, inf_file, -1, &InfFile[0], sizeof(InfFile) / sizeof(InfFile[0]) - 1)) == 0) { ANALYSIS SUMMARY: Hits = 726 Lines analyzed = 74870 in approximately 1.89 seconds (39678 lines/second) Physical Source Lines of Code (SLOC) = 57745 Hits@level = [0] 1569 [1] 136 [2] 425 [3] 44 [4] 118 [5] 3 Hits@level+ = [0+] 2295 [1+] 726 [2+] 590 [3+] 165 [4+] 121 [5+] 3 Hits/KSLOC@level+ = [0+] 39.7437 [1+] 12.5725 [2+] 10.2173 [3+] 2.85739 [4+] 2.09542 [5+] 0.0519526 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.