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/repmgr-5.2.0/compat.c Examining data/repmgr-5.2.0/compat.h Examining data/repmgr-5.2.0/configdata.c Examining data/repmgr-5.2.0/configfile.c Examining data/repmgr-5.2.0/configfile.h Examining data/repmgr-5.2.0/controldata.c Examining data/repmgr-5.2.0/controldata.h Examining data/repmgr-5.2.0/dbutils.c Examining data/repmgr-5.2.0/dbutils.h Examining data/repmgr-5.2.0/dirutil.c Examining data/repmgr-5.2.0/dirutil.h Examining data/repmgr-5.2.0/errcode.h Examining data/repmgr-5.2.0/log.c Examining data/repmgr-5.2.0/log.h Examining data/repmgr-5.2.0/repmgr-action-cluster.c Examining data/repmgr-5.2.0/repmgr-action-cluster.h Examining data/repmgr-5.2.0/repmgr-action-daemon.c Examining data/repmgr-5.2.0/repmgr-action-daemon.h Examining data/repmgr-5.2.0/repmgr-action-node.c Examining data/repmgr-5.2.0/repmgr-action-node.h Examining data/repmgr-5.2.0/repmgr-action-primary.c Examining data/repmgr-5.2.0/repmgr-action-primary.h Examining data/repmgr-5.2.0/repmgr-action-service.c Examining data/repmgr-5.2.0/repmgr-action-service.h Examining data/repmgr-5.2.0/repmgr-action-standby.c Examining data/repmgr-5.2.0/repmgr-action-standby.h Examining data/repmgr-5.2.0/repmgr-action-witness.c Examining data/repmgr-5.2.0/repmgr-action-witness.h Examining data/repmgr-5.2.0/repmgr-client-global.h Examining data/repmgr-5.2.0/repmgr-client.c Examining data/repmgr-5.2.0/repmgr-client.h Examining data/repmgr-5.2.0/repmgr.c Examining data/repmgr-5.2.0/repmgr.h Examining data/repmgr-5.2.0/repmgrd-physical.c Examining data/repmgr-5.2.0/repmgrd-physical.h Examining data/repmgr-5.2.0/repmgrd.c Examining data/repmgr-5.2.0/repmgrd.h Examining data/repmgr-5.2.0/strutil.c Examining data/repmgr-5.2.0/strutil.h Examining data/repmgr-5.2.0/sysutils.c Examining data/repmgr-5.2.0/sysutils.h Examining data/repmgr-5.2.0/voting.h FINAL RESULTS: data/repmgr-5.2.0/dirutil.c:114:10: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. return (chmod(path, 0700) != 0) ? false : true; data/repmgr-5.2.0/repmgr-action-node.c:3542:2: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(dest_file, S_IRUSR | S_IWUSR); data/repmgr-5.2.0/repmgr-action-standby.c:7020:6: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(prefix, backup_id, MAXLEN - 1); data/repmgr-5.2.0/repmgr-action-standby.c:7021:6: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(prefix, "/", MAXLEN - 1); data/repmgr-5.2.0/dbutils.c:78:11: [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. retval = vsnprintf(buf, MAXLEN, fmt, ap); data/repmgr-5.2.0/dbutils.c:4276: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. r = system(parsed_command); data/repmgr-5.2.0/log.c:96:3: [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/repmgr-5.2.0/log.h:62:3: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. syslog(LOG_DEBUG, __VA_ARGS__); \ data/repmgr-5.2.0/log.h:68:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (log_type == REPMGR_SYSLOG) syslog(LOG_INFO, __VA_ARGS__); \ data/repmgr-5.2.0/log.h:74:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (log_type == REPMGR_SYSLOG) syslog(LOG_NOTICE, __VA_ARGS__); \ data/repmgr-5.2.0/log.h:80:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (log_type == REPMGR_SYSLOG) syslog(LOG_WARNING, __VA_ARGS__); \ data/repmgr-5.2.0/log.h:86:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (log_type == REPMGR_SYSLOG) syslog(LOG_ERROR, __VA_ARGS__); \ data/repmgr-5.2.0/log.h:92:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (log_type == REPMGR_SYSLOG) syslog(LOG_CRIT, __VA_ARGS__); \ data/repmgr-5.2.0/log.h:98:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (log_type == REPMGR_SYSLOG) syslog(LOG_ALERT, __VA_ARGS__); \ data/repmgr-5.2.0/log.h:104:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (log_type == REPMGR_SYSLOG) syslog(LOG_ALERT, __VA_ARGS__); \ data/repmgr-5.2.0/repmgr-action-standby.c:774: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. r = system(command.data); data/repmgr-5.2.0/repmgr-action-standby.c:2637:8: [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. r = system(script); data/repmgr-5.2.0/repmgr-action-standby.c:6785:6: [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. r = system(script.data); data/repmgr-5.2.0/repmgr-action-standby.c:6979:9: [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. fi = popen(command, "r"); data/repmgr-5.2.0/repmgr-client.c:2979: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. r = system(script); data/repmgr-5.2.0/repmgr-client.c:3181:6: [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. r = system(script); data/repmgr-5.2.0/repmgr-client.c:4515:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(version_string, sscanf_string.data, &series, &major, &minor) == 3) data/repmgr-5.2.0/repmgr.h:24:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #ifdef vsnprintf data/repmgr-5.2.0/repmgr.h:25:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #undef vsnprintf data/repmgr-5.2.0/repmgr.h:27: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. #ifdef snprintf data/repmgr-5.2.0/repmgr.h:28: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. #undef snprintf data/repmgr-5.2.0/repmgr.h:30:8: [4] (buffer) vsprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #ifdef vsprintf data/repmgr-5.2.0/repmgr.h:31:8: [4] (buffer) vsprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #undef vsprintf data/repmgr-5.2.0/repmgr.h:33:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #ifdef sprintf data/repmgr-5.2.0/repmgr.h:34:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. #undef sprintf data/repmgr-5.2.0/repmgr.h:36:8: [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. #ifdef vfprintf data/repmgr-5.2.0/repmgr.h:37:8: [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. #undef vfprintf data/repmgr-5.2.0/repmgr.h:39:8: [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. #ifdef fprintf data/repmgr-5.2.0/repmgr.h:40:8: [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. #undef fprintf data/repmgr-5.2.0/repmgr.h:42: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. #ifdef vprintf data/repmgr-5.2.0/repmgr.h:43: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. #undef vprintf data/repmgr-5.2.0/repmgr.h:45:8: [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. #ifdef printf data/repmgr-5.2.0/repmgr.h:46:8: [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. #undef printf data/repmgr-5.2.0/repmgrd-physical.c:1199:45: [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. child_nodes_disconnect_command_result = system(parsed_child_nodes_disconnect_command); data/repmgr-5.2.0/repmgrd-physical.c:3350:26: [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. standby_follow_result = system(parsed_follow_command); data/repmgr-5.2.0/repmgrd-physical.c:3583:6: [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. r = system(promote_command); data/repmgr-5.2.0/repmgrd-physical.c:3883:6: [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. r = system(parsed_follow_command); data/repmgr-5.2.0/strutil.c:40:11: [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. retval = vsnprintf(str, size, format, ap); data/repmgr-5.2.0/sysutils.c:88:12: [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. retval = system(command_final.data); data/repmgr-5.2.0/sysutils.c:99:7: [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. fp = popen(command_final.data, "r"); data/repmgr-5.2.0/sysutils.c:182:7: [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. fp = popen(ssh_command.data, "r"); data/repmgr-5.2.0/configfile.c:95:10: [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. pwd = getenv("PWD"); data/repmgr-5.2.0/configfile.c:2107: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. while ((c = getopt_long(argc_item, argv_array, "S:X:", long_options, data/repmgr-5.2.0/repmgr-action-standby.c:8540: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. while ((c = getopt_long(argc_item, argv_array, "L:S:", node_status_options, data/repmgr-5.2.0/repmgr-action-standby.c:8610: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. while ((c = getopt_long(argc_item, argv_array, "L:S:", node_check_options, data/repmgr-5.2.0/repmgr-action-standby.c:8680: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. while ((c = getopt_long(argc_item, argv_array, "f:S:t:", node_check_options, data/repmgr-5.2.0/repmgr-action-standby.c:8745: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. while ((c = getopt_long(argc_item, argv_array, "C:E:", node_check_options, data/repmgr-5.2.0/repmgr-action-standby.c:8803: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. while ((c = getopt_long(argc_item, argv_array, "C:", node_check_options, data/repmgr-5.2.0/repmgr-action-standby.c:8856: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. while ((c = getopt_long(argc_item, argv_array, "c:", node_check_options, data/repmgr-5.2.0/repmgr-client.c:191: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. while ((c = getopt_long(argc, argv, "?Vb:f:FwWd:h:p:U:R:S:D:ck:L:qtvC:", long_options, data/repmgr-5.2.0/repmgrd.c:130:2: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/repmgr-5.2.0/repmgrd.c:134: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. while ((c = getopt_long(argc, argv, "?Vf:L:vdp:m", long_options, &optindex)) != -1) data/repmgr-5.2.0/repmgrd.c:285: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. const char *tmpdir = getenv("TMPDIR"); data/repmgr-5.2.0/sysutils.c:61:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *tmpdir = getenv("TMPDIR"); data/repmgr-5.2.0/configfile.c:33: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 config_file_path[MAXPGPATH] = ""; data/repmgr-5.2.0/configfile.c:104: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 cwd[MAXPGPATH] = ""; data/repmgr-5.2.0/configfile.c:167: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 package_conf_file[MAXPGPATH] = ""; data/repmgr-5.2.0/configfile.c:168: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 my_exec_path[MAXPGPATH] = ""; data/repmgr-5.2.0/configfile.c:169: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 sysconf_etc_path[MAXPGPATH] = ""; data/repmgr-5.2.0/configfile.c:277:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char base_directory[MAXPGPATH]; data/repmgr-5.2.0/configfile.c:349: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(config_file_path, "r"); data/repmgr-5.2.0/configfile.c:648:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_conf_path[MAXPGPATH] = ""; data/repmgr-5.2.0/configfile.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 name[MAXLEN] = ""; data/repmgr-5.2.0/configfile.c:653:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char value[MAXLEN] = ""; data/repmgr-5.2.0/configfile.c:660: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(recovery_conf_path, "r"); data/repmgr-5.2.0/configfile.c:706: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). conf->recovery_target_timeline = atoi(value); data/repmgr-5.2.0/configfile.c:1629:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(copy, original, (int)sizeof(t_configuration_options)); data/repmgr-5.2.0/configfile.c:1826: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(auto_conf_tmp.data, "w"); data/repmgr-5.2.0/configfile.c:1887:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char event_type_buf[MAXLEN] = ""; data/repmgr-5.2.0/configfile.c:2046:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. pfree((char *)local_argv_array[i]); data/repmgr-5.2.0/configfile.h:38: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 config_file_path[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:56:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char event_type[MAXLEN]; data/repmgr-5.2.0/configfile.h:70:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char old_dir[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:71:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char new_dir[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:134:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char node_name[NAMEDATALEN]; data/repmgr-5.2.0/configfile.h:135:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char conninfo[MAXLEN]; data/repmgr-5.2.0/configfile.h:136:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char replication_user[NAMEDATALEN]; data/repmgr-5.2.0/configfile.h:137:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_directory[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:138:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_directory[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:139:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pg_bindir[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:140:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repmgr_bindir[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:144:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char log_level[MAXLEN]; data/repmgr-5.2.0/configfile.h:145:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char log_facility[MAXLEN]; data/repmgr-5.2.0/configfile.h: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 log_file[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:151:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pg_basebackup_options[MAXLEN]; data/repmgr-5.2.0/configfile.h:152:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char restore_command[MAXLEN]; data/repmgr-5.2.0/configfile.h:154:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_min_apply_delay[MAXLEN]; data/repmgr-5.2.0/configfile.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 archive_cleanup_command[MAXLEN]; data/repmgr-5.2.0/configfile.h:158:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char passfile[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:188:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char location[MAXLEN]; data/repmgr-5.2.0/configfile.h:190:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char promote_command[MAXLEN]; data/repmgr-5.2.0/configfile.h:191:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char follow_command[MAXLEN]; data/repmgr-5.2.0/configfile.h:200:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repmgrd_pid_file[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:206:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char failover_validation_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h: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 child_nodes_disconnect_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:216:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pg_ctl_options[MAXLEN]; data/repmgr-5.2.0/configfile.h:217:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char service_start_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:218:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char service_stop_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:219:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char service_restart_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:220:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char service_reload_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:221:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char service_promote_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:224:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repmgrd_service_start_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:225:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repmgrd_service_stop_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:228:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char event_notification_command[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:229:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char event_notifications_orig[MAXLEN]; data/repmgr-5.2.0/configfile.h:233:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char barman_host[MAXLEN]; data/repmgr-5.2.0/configfile.h:234:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char barman_server[MAXLEN]; data/repmgr-5.2.0/configfile.h:235:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char barman_config[MAXLEN]; data/repmgr-5.2.0/configfile.h:238:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char rsync_options[MAXLEN]; data/repmgr-5.2.0/configfile.h:239:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ssh_options[MAXLEN]; data/repmgr-5.2.0/configfile.h:254:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char connection_check_query[MAXLEN]; data/repmgr-5.2.0/configfile.h:263:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char slot[MAXLEN]; data/repmgr-5.2.0/configfile.h:264:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char wal_method[MAXLEN]; data/repmgr-5.2.0/configfile.h:265:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char waldir[MAXPGPATH]; data/repmgr-5.2.0/configfile.h:291:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char restore_command[MAXLEN]; data/repmgr-5.2.0/configfile.h:292:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char archive_cleanup_command[MAXLEN]; data/repmgr-5.2.0/configfile.h:293:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_end_command[MAXLEN]; data/repmgr-5.2.0/configfile.h:295:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_target_name[MAXLEN]; data/repmgr-5.2.0/configfile.h:296:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_target_time[MAXLEN]; data/repmgr-5.2.0/configfile.h:297:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_target_xid[MAXLEN]; data/repmgr-5.2.0/configfile.h:303:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char primary_conninfo[MAXLEN]; data/repmgr-5.2.0/configfile.h:304:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char primary_slot_name[MAXLEN]; data/repmgr-5.2.0/configfile.h:305:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char trigger_file[MAXLEN]; data/repmgr-5.2.0/configfile.h: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 recovery_min_apply_delay[MAXLEN]; data/repmgr-5.2.0/controldata.c:42:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char PgVersionPath[MAXPGPATH] = ""; data/repmgr-5.2.0/controldata.c:45:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char file_version_string[MAX_VERSION_STRING] = ""; data/repmgr-5.2.0/controldata.c:51: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(PgVersionPath, "r"); data/repmgr-5.2.0/controldata.c:235:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char file_version_string[MAX_VERSION_STRING] = ""; data/repmgr-5.2.0/controldata.c:238:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ControlFilePath[MAXPGPATH] = ""; data/repmgr-5.2.0/controldata.c:278:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(ControlFilePath, O_RDONLY | PG_BINARY, 0)) == -1) data/repmgr-5.2.0/dbutils.c:74:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXLEN]; data/repmgr-5.2.0/dbutils.c:1204:19: [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_output = atoi(PQgetvalue(res, i, 1)); data/repmgr-5.2.0/dbutils.c:1336:24: [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). _server_version_num = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:1341: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 _server_version_buf[MAXVERSIONSTR] = ""; data/repmgr-5.2.0/dbutils.c:1426:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char remote_conninfo_stack[MAXCONNINFO]; data/repmgr-5.2.0/dbutils.c:1477:13: [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). node_id = atoi(PQgetvalue(res, i, 0)); data/repmgr-5.2.0/dbutils.c:1570: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). retval = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:1585:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char archive_status_dir[MAXPGPATH] = ""; data/repmgr-5.2.0/dbutils.c:1629: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 file_path[MAXPGPATH + sizeof(arcdir_ent->d_name)]; data/repmgr-5.2.0/dbutils.c:1678:38: [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). identification->system_identifier = atol(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:1681:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). identification->timeline = atoi(PQgetvalue(res, 0, 1)); data/repmgr-5.2.0/dbutils.c:1720:23: [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). system_identifier = atol(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:1780: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[MAXLEN]; data/repmgr-5.2.0/dbutils.c:2039:19: [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). local_node_id = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:2162:17: [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). repmgrd_pid = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:2262:22: [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). wal_receiver_pid = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:2287:22: [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). upstream_node_id = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:2381:27: [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 available_version = atoi(PQgetvalue(res, 0, 3)); data/repmgr-5.2.0/dbutils.c:2382:27: [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 installed_version = atoi(PQgetvalue(res, 0, 5)); data/repmgr-5.2.0/dbutils.c:2590: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). node_info->node_id = atoi(PQgetvalue(res, row, 0)); data/repmgr-5.2.0/dbutils.c:2599: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). node_info->upstream_node_id = atoi(PQgetvalue(res, row, 2)); data/repmgr-5.2.0/dbutils.c:2607:24: [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). node_info->priority = atoi(PQgetvalue(res, row, 8)); data/repmgr-5.2.0/dbutils.c:2940: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). *count = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:3199:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char node_id[MAXLEN] = ""; data/repmgr-5.2.0/dbutils.c:3200:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char priority[MAXLEN] = ""; data/repmgr-5.2.0/dbutils.c:3202:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char upstream_node_id[MAXLEN] = ""; data/repmgr-5.2.0/dbutils.c:3208:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *param_values[NODE_RECORD_PARAM_COUNT]; data/repmgr-5.2.0/dbutils.c:4034:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char event_timestamp[MAXLEN] = ""; data/repmgr-5.2.0/dbutils.c:4048: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. const char *values[4] = {(char *) &n_node_id, data/repmgr-5.2.0/dbutils.c:4124: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 parsed_command[MAXPGPATH] = ""; data/repmgr-5.2.0/dbutils.c:4686:16: [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). free_slots = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:4688:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *max_replication_slots = atoi(PQgetvalue(res, 0, 1)); data/repmgr-5.2.0/dbutils.c:4795:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char errbuf[ERRBUFF_SIZE] = ""; data/repmgr-5.2.0/dbutils.c:5106:18: [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). record_count = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:5182:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). term = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:5316: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). new_primary_node_id = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:5633:44: [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). replication_info->replication_lag_time = atoi(PQgetvalue(res, 0, 5)); data/repmgr-5.2.0/dbutils.c:5636:42: [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). replication_info->upstream_last_seen = atoi(PQgetvalue(res, 0, 8)); data/repmgr-5.2.0/dbutils.c:5637: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). replication_info->upstream_node_id = atoi(PQgetvalue(res, 0, 9)); data/repmgr-5.2.0/dbutils.c:5691:16: [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). lag_seconds = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:5719:18: [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). timeline_id = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:5775:31: [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). node_info->max_wal_senders = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.c:5776: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). node_info->attached_wal_receivers = atoi(PQgetvalue(res, 0, 1)); data/repmgr-5.2.0/dbutils.c:5777:37: [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). node_info->max_replication_slots = atoi(PQgetvalue(res, 0, 2)); data/repmgr-5.2.0/dbutils.c:5778: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). node_info->total_replication_slots = atoi(PQgetvalue(res, 0, 3)); data/repmgr-5.2.0/dbutils.c:5779: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). node_info->active_replication_slots = atoi(PQgetvalue(res, 0, 4)); data/repmgr-5.2.0/dbutils.c:5780:42: [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). node_info->inactive_replication_slots = atoi(PQgetvalue(res, 0, 5)); data/repmgr-5.2.0/dbutils.c:5940:24: [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). upstream_last_seen = atoi(PQgetvalue(res, 0, 0)); data/repmgr-5.2.0/dbutils.h:155:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char default_version[8]; data/repmgr-5.2.0/dbutils.h:157:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char installed_version[8]; data/repmgr-5.2.0/dbutils.h:171:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char current_timestamp[MAXLEN]; data/repmgr-5.2.0/dbutils.h: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 timeline_id_str[MAXLEN]; data/repmgr-5.2.0/dbutils.h:177:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char last_xact_replay_timestamp[MAXLEN]; data/repmgr-5.2.0/dbutils.h:198:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char node_name[NAMEDATALEN]; data/repmgr-5.2.0/dbutils.h:199:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char upstream_node_name[NAMEDATALEN]; data/repmgr-5.2.0/dbutils.h:200:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char conninfo[MAXLEN]; data/repmgr-5.2.0/dbutils.h:201:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repluser[NAMEDATALEN]; data/repmgr-5.2.0/dbutils.h:202:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char location[MAXLEN]; data/repmgr-5.2.0/dbutils.h:205:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char slot_name[MAXLEN]; data/repmgr-5.2.0/dbutils.h:206:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXPGPATH]; data/repmgr-5.2.0/dbutils.h:214:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char details[MAXLEN]; data/repmgr-5.2.0/dbutils.h:312:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char slot_name[MAXLEN]; data/repmgr-5.2.0/dbutils.h:313:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char slot_type[MAXLEN]; data/repmgr-5.2.0/dbutils.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 username[MAXLEN]; data/repmgr-5.2.0/dbutils.h:331:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filepath[MAXPGPATH]; data/repmgr-5.2.0/dbutils.h:332:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[MAXPGPATH]; data/repmgr-5.2.0/dbutils.h:366:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pid_text[MAXLEN]; data/repmgr-5.2.0/dbutils.h:367:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pid_file[MAXLEN]; data/repmgr-5.2.0/dbutils.h:369:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pg_running_text[MAXLEN]; data/repmgr-5.2.0/dbutils.h:372:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repmgrd_running[MAXLEN]; data/repmgr-5.2.0/dbutils.h:376:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char upstream_last_seen_text[MAXLEN]; data/repmgr-5.2.0/dirutil.c:96:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char create_dir_path[MAXPGPATH]; data/repmgr-5.2.0/dirutil.c:207:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dirpath[MAXPGPATH] = ""; data/repmgr-5.2.0/dirutil.c:235:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pid_file[MAXPGPATH]; data/repmgr-5.2.0/dirutil.c:240: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). pidf = fopen(pid_file, "r"); data/repmgr-5.2.0/log.c:69:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100]; data/repmgr-5.2.0/log.c:263: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). fd = fopen(opts->log_file, "a"); data/repmgr-5.2.0/log.c:377:11: [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). local = atoi(&facility[5]); data/repmgr-5.2.0/repmgr-action-cluster.c:192: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 error[MAXLEN]; data/repmgr-5.2.0/repmgr-action-cluster.h:33:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char node_name[NAMEDATALEN]; data/repmgr-5.2.0/repmgr-action-cluster.h:40:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char node_name[NAMEDATALEN]; data/repmgr-5.2.0/repmgr-action-node.c:75:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cluster_size[MAXLEN]; data/repmgr-5.2.0/repmgr-action-node.c:87:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_dir[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-node.c:88:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char server_version_str[MAXVERSIONSTR] = ""; data/repmgr-5.2.0/repmgr-action-node.c:194: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 archive_command[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-node.c:2032:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char actual_data_directory[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-node.c:2267:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_dir[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-node.c:2268:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char command[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-node.c:2389:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char command[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-node.c:2391:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_dir[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-node.c:2811: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 standby_signal_file_path[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-node.c:3267: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 filenamebuf[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-node.c:3529: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). ptr_old = fopen(src_file, "r"); data/repmgr-5.2.0/repmgr-action-node.c:3534: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). ptr_new = fopen(dest_file, "w"); data/repmgr-5.2.0/repmgr-action-service.c:151: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 error[MAXLEN]; data/repmgr-5.2.0/repmgr-action-standby.c:70: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 local_data_directory[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:76: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 recovery_conninfo_str[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:77: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 upstream_repluser[NAMEDATALEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:78: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 upstream_user[NAMEDATALEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:87: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 local_repmgr_tmp_directory[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:88: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 datadir_list_filename[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:89: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 barman_command_buf[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:257: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 application_name[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:1083:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_file_path[MAXPGPATH + sizeof(RECOVERY_COMMAND_FILE)] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:1399: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 recovery_conf_contents[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:2558:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_dir[MAXPGPATH]; data/repmgr-5.2.0/repmgr-action-standby.c:2627: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 script[MAXLEN]; data/repmgr-5.2.0/repmgr-action-standby.c:3354: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 server_command[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:3557:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char remote_conninfo[MAXCONNINFO] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:3558:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char remote_host[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:4948: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 shutdown_command[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:5549:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cluster_size[MAXLEN]; data/repmgr-5.2.0/repmgr-action-standby.c:5904:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:5905:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char barman_conninfo_str[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:5910:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char where_condition[MAXLEN]; data/repmgr-5.2.0/repmgr-action-standby.c:6520: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 name[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6933:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char command[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6934:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6935:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6936:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char basebackups_directory[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6937:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char backup_id[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6967: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 prefix[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6968: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 output[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:6986: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). fd = fopen(datadir_list_filename, "w"); data/repmgr-5.2.0/repmgr-action-standby.c:7051: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). fi2 = fopen(filename, "r"); data/repmgr-5.2.0/repmgr-action-standby.c:7101:23: [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). cell_t->fptr = fopen(filename, "w"); data/repmgr-5.2.0/repmgr-action-standby.c:7425:25: [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). tablespace_map_file = fopen(tablespace_map_filename.data, "w"); data/repmgr-5.2.0/repmgr-action-standby.c:7567: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 config_opt[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7592:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7593:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char oid[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7594:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char location[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7653:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7654:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char command[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7803:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char standby_version[MAXVERSIONSTR] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7806:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char primary_version[MAXVERSIONSTR] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7870:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_file_path[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:7992:18: [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). recovery_file = fopen(recovery_file_path, "w"); data/repmgr-5.2.0/repmgr-action-standby.c:8132:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:8367:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-action-standby.c:8687:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *files = atoi(optarg); data/repmgr-5.2.0/repmgr-action-standby.c:8691:18: [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). *threshold = atoi(optarg); data/repmgr-5.2.0/repmgr-action-witness.c:31: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 repmgr_user[MAXLEN]; data/repmgr-5.2.0/repmgr-action-witness.c:32: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 repmgr_db[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:43:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char config_file[MAXPGPATH]; data/repmgr-5.2.0/repmgr-client-global.h:46:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pg_bindir[MAXLEN]; /* overrides setting in repmgr.conf */ data/repmgr-5.2.0/repmgr-client-global.h: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 log_level[MAXLEN]; /* overrides setting in repmgr.conf */ data/repmgr-5.2.0/repmgr-client-global.h:66:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dbname[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:67:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:68:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char username[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:69:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char port[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:72:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char remote_user[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:73:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char superuser[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:77:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char node_name[NAMEDATALEN]; data/repmgr-5.2.0/repmgr-client-global.h:78:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_dir[MAXPGPATH]; data/repmgr-5.2.0/repmgr-client-global.h:87:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char recovery_min_apply_delay[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:88:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char replication_user[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:89:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char upstream_conninfo[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:105:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char force_rewind_path[MAXPGPATH]; data/repmgr-5.2.0/repmgr-client-global.h:128:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_files[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:131:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char action[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:138:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char event[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:145:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char config_archive_dir[MAXPGPATH]; data/repmgr-5.2.0/repmgr-client-global.h:237:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char title[MAXLEN]; data/repmgr-5.2.0/repmgr-client-global.h:252: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 pg_bindir[MAXLEN]; data/repmgr-5.2.0/repmgr-client.c:84: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 pg_bindir[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-client.c:2885:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char version_string[MAXVERSIONSTR] = ""; data/repmgr-5.2.0/repmgr-client.c:2953:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char script[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-client.c:3089:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char script[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-client.c:3090:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char host_string[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-client.c:3581: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 repluser[MAXLEN] = ""; data/repmgr-5.2.0/repmgr-client.c:3658:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char standby_signal_file_path[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgr-client.c:3666: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(standby_signal_file_path, "w"); data/repmgr-5.2.0/repmgr-client.c:4407: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 conf_owner[MAXLEN]; data/repmgr-5.2.0/repmgr-client.c:4408: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 dir_owner[MAXLEN]; data/repmgr-5.2.0/repmgr.c:70:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repmgrd_pidfile[MAXPGPATH]; data/repmgr-5.2.0/repmgr.c:259: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 buffer[REPMGRD_STATE_FILE_BUF_SIZE]; data/repmgr-5.2.0/repmgr.c:580:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char repmgrd_pidfile[MAXPGPATH]; data/repmgr-5.2.0/repmgrd-physical.c:65:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char node_name[NAMEDATALEN]; data/repmgr-5.2.0/repmgrd-physical.c:1183: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 parsed_child_nodes_disconnect_command[MAXPGPATH]; data/repmgr-5.2.0/repmgrd-physical.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 parsed_follow_command[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgrd-physical.c:3801:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char parsed_follow_command[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgrd.c:37: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 pid_file[MAXPGPATH]; data/repmgr-5.2.0/repmgrd.c:81:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cli_log_level[MAXLEN] = ""; data/repmgr-5.2.0/repmgrd.c:277: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 package_pid_file[MAXPGPATH] = ""; data/repmgr-5.2.0/repmgrd.c:606:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *ptr, data/repmgr-5.2.0/repmgrd.c:683:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[MAXLEN]; data/repmgr-5.2.0/repmgrd.c:691: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). fd = fopen(pid_file, "r"); data/repmgr-5.2.0/repmgrd.c:710:9: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pid = atoi(buff); data/repmgr-5.2.0/repmgrd.c:723: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). fd = fopen(pid_file, "w"); data/repmgr-5.2.0/repmgrd.h:23: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 pid_file[MAXPGPATH]; data/repmgr-5.2.0/strutil.c:85:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char stringbuf[MAXLEN]; data/repmgr-5.2.0/strutil.c:185:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char formatted_value[MAXLEN]; data/repmgr-5.2.0/sysutils.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 output[MAXLEN]; data/repmgr-5.2.0/sysutils.c:60:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpfile_path[MAXPGPATH]; data/repmgr-5.2.0/sysutils.c:71:7: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp(tmpfile_path); data/repmgr-5.2.0/sysutils.c:132: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(tmpfile_path, "r"); data/repmgr-5.2.0/sysutils.c:173:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char output[MAXLEN] = ""; data/repmgr-5.2.0/sysutils.c:255:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXLEN]; data/repmgr-5.2.0/sysutils.c:286:32: [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). wal_retrieve_retry_interval = atoi(buf); data/repmgr-5.2.0/sysutils.c:350:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[MAXLEN]; data/repmgr-5.2.0/sysutils.c:377:32: [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). wal_retrieve_retry_interval = atoi(buf); data/repmgr-5.2.0/configfile.c:79:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_file_path, config_file, MAXPGPATH); data/repmgr-5.2.0/configfile.c:124:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_file_path, fullpath.data, MAXPGPATH); data/repmgr-5.2.0/configfile.c:179:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_file_path, package_conf_file, MAXPGPATH); data/repmgr-5.2.0/configfile.c:307:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *)setting->val.strptr, setting->defval.strdefault, setting->maxval.strmaxlen); data/repmgr-5.2.0/configfile.c:369:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(base_directory, config_file_path, MAXPGPATH); data/repmgr-5.2.0/configfile.c:388:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(config_file_options.node_name)) data/repmgr-5.2.0/configfile.c:393:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(config_file_options.data_directory)) data/repmgr-5.2.0/configfile.c:398:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(config_file_options.conninfo)) data/repmgr-5.2.0/configfile.c:492: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(value) > setting->maxval.strmaxlen) data/repmgr-5.2.0/configfile.c:498: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). (int)strlen(value)); data/repmgr-5.2.0/configfile.c:510:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *)setting->val.strptr, value, setting->maxval.strmaxlen); data/repmgr-5.2.0/configfile.c:675:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(name)) data/repmgr-5.2.0/configfile.c:684:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->restore_command, value, MAXLEN); data/repmgr-5.2.0/configfile.c:686:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->archive_cleanup_command, value, MAXLEN); data/repmgr-5.2.0/configfile.c:688:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->recovery_end_command, value, MAXLEN); data/repmgr-5.2.0/configfile.c:691:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->recovery_target_name, value, MAXLEN); data/repmgr-5.2.0/configfile.c:693:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->recovery_target_time, value, MAXLEN); data/repmgr-5.2.0/configfile.c:695:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->recovery_target_xid, value, MAXLEN); data/repmgr-5.2.0/configfile.c:724:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->primary_conninfo, value, MAXLEN); data/repmgr-5.2.0/configfile.c:726:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->trigger_file, value, MAXLEN); data/repmgr-5.2.0/configfile.c:728:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf->trigger_file, value, MAXLEN); data/repmgr-5.2.0/configfile.c:834:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dest, value, MAXLEN); data/repmgr-5.2.0/configfile.c:1726:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(copy_cell->old_dir, orig_cell->old_dir, sizeof(copy_cell->old_dir)); data/repmgr-5.2.0/configfile.c:1727:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(copy_cell->new_dir, orig_cell->new_dir, sizeof(copy_cell->new_dir)); data/repmgr-5.2.0/configfile.c:1825:7: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). um = umask(~(auto_conf_st.st_mode)); data/repmgr-5.2.0/configfile.c:1827:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(um); data/repmgr-5.2.0/configfile.c:1837: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 (fwrite(auto_conf_contents.data, strlen(auto_conf_contents.data), 1, fp) != 1) data/repmgr-5.2.0/configfile.c:1890: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). for (arg_ptr = arg; arg_ptr <= (arg + strlen(arg)); arg_ptr++) data/repmgr-5.2.0/configfile.c:1914:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cell->event_type, event_type_buf, MAXLEN); data/repmgr-5.2.0/configfile.c:1984: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). options_len = strlen(string) + 1; data/repmgr-5.2.0/configfile.c:1989:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(options_string, string, options_len); data/repmgr-5.2.0/configfile.c:2019:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int argv_len = strlen(cell->string) + 1; data/repmgr-5.2.0/configfile.c:2023:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(local_argv_array[c], cell->string, argv_len); data/repmgr-5.2.0/configfile.c:2091: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(pg_basebackup_options)) data/repmgr-5.2.0/configfile.c:2113:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(backup_options->slot, optarg, MAXLEN); data/repmgr-5.2.0/configfile.c:2116:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(backup_options->wal_method, optarg, MAXLEN); data/repmgr-5.2.0/configfile.c:2119:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(backup_options->waldir, optarg, MAXPGPATH); data/repmgr-5.2.0/configfile.c:2209: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). ptr = palloc0(strlen(buf.data) + 1); data/repmgr-5.2.0/configfile.c:2210:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ptr, buf.data, strlen(buf.data)); data/repmgr-5.2.0/configfile.c:2210: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). strncpy(ptr, buf.data, strlen(buf.data)); data/repmgr-5.2.0/configfile.c:2239: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). ptr = palloc0(strlen(buf.data) + 1); data/repmgr-5.2.0/configfile.c:2240:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ptr, buf.data, strlen(buf.data)); data/repmgr-5.2.0/configfile.c:2240: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). strncpy(ptr, buf.data, strlen(buf.data)); data/repmgr-5.2.0/controldata.c:63:8: [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. ret = fscanf(fp, "%23s", file_version_string); data/repmgr-5.2.0/controldata.c:80:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(version_string, file_version_string, MAX_VERSION_STRING); data/repmgr-5.2.0/controldata.c:309:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, ControlFileDataPtr, expected_size) != expected_size) data/repmgr-5.2.0/dbutils.c:487:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(output, conninfo_option->val, MAXLEN); data/repmgr-5.2.0/dbutils.c:519:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(output, def->val, maxlen); data/repmgr-5.2.0/dbutils.c:612:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int value_len = strlen(value) + 1; data/repmgr-5.2.0/dbutils.c:626:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_list->values[c], value, value_len); data/repmgr-5.2.0/dbutils.c:642: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). param_len = strlen(param) + 1; data/repmgr-5.2.0/dbutils.c:647:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_list->keywords[c], param, param_len); data/repmgr-5.2.0/dbutils.c:648:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_list->values[c], value, value_len); data/repmgr-5.2.0/dbutils.c:659:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int value_len = strlen(value) + 1; data/repmgr-5.2.0/dbutils.c:684: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). param_len = strlen(param) + 1; data/repmgr-5.2.0/dbutils.c:689:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_list->keywords[c], param, param_len); data/repmgr-5.2.0/dbutils.c:690:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(param_list->values[c], value, value_len); data/repmgr-5.2.0/dbutils.c:850: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(conninfo_buf.data) + 1; data/repmgr-5.2.0/dbutils.c:853:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conninfo_str, conninfo_buf.data, len); data/repmgr-5.2.0/dbutils.c:1643: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). basenamelen = (int) strlen(arcdir_ent->d_name) - 6; data/repmgr-5.2.0/dbutils.c:4109: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(event_timestamp)) data/repmgr-5.2.0/dbutils.c:4122: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 (send_notification == true && strlen(options->event_notification_command)) data/repmgr-5.2.0/dbutils.c:4186: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). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:4195:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:4202: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). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:4215:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:4223: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). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:4229: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). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:4239:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:4252:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/dbutils.c:5730:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(timeline_id_str, "?", MAXLEN); data/repmgr-5.2.0/dbutils.c:5857: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). int state_len = strlen(state); data/repmgr-5.2.0/dbutils.c:5859:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*node_state, state, state_len); data/repmgr-5.2.0/dirutil.c:99:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(create_dir_path, path, MAXPGPATH); data/repmgr-5.2.0/dirutil.c:169:13: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). oumask = umask(0); data/repmgr-5.2.0/dirutil.c:171:11: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask(numask); data/repmgr-5.2.0/dirutil.c:175:11: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask(oumask); data/repmgr-5.2.0/dirutil.c:199:10: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). (void) umask(oumask); data/repmgr-5.2.0/log.c:375: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 (!strncmp(facility, "LOCAL", 5) && strlen(facility) == 6) data/repmgr-5.2.0/repmgr-action-cluster.c:86:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(config_file_options.conninfo)) data/repmgr-5.2.0/repmgr-action-cluster.c:109:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_ID].title, _("ID"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:110:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_NAME].title, _("Name"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:111:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_ROLE].title, _("Role"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:112:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_STATUS].title, _("Status"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:113:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_UPSTREAM_NAME].title, _("Upstream"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:114:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_LOCATION].title, _("Location"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:118:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_PRIORITY].title, _("Prio."), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:119:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_TIMELINE_ID].title, _("TLI"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:123:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_PRIORITY].title, _("Priority"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:124:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_TIMELINE_ID].title, _("Timeline"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:127:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_show[SHOW_CONNINFO].title, _("Connection string"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:159: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). headers_show[i].max_length = strlen(headers_show[i].title); data/repmgr-5.2.0/repmgr-action-cluster.c:194:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(error, PQerrorMessage(cell->node_info->conn), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:232:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_show[SHOW_ID].cur_length = strlen(buf.data); data/repmgr-5.2.0/repmgr-action-cluster.c:235: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). headers_show[SHOW_ROLE].cur_length = strlen(get_node_type_string(cell->node_info->type)); data/repmgr-5.2.0/repmgr-action-cluster.c:236: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). headers_show[SHOW_NAME].cur_length = strlen(cell->node_info->node_name); data/repmgr-5.2.0/repmgr-action-cluster.c:237: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). headers_show[SHOW_STATUS].cur_length = strlen(cell->node_info->details); data/repmgr-5.2.0/repmgr-action-cluster.c:239:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_show[SHOW_UPSTREAM_NAME].cur_length = strlen(cell->node_info->upstream_node_name); data/repmgr-5.2.0/repmgr-action-cluster.c:243: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). headers_show[SHOW_PRIORITY].cur_length = strlen(buf.data); data/repmgr-5.2.0/repmgr-action-cluster.c:246: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). headers_show[SHOW_LOCATION].cur_length = strlen(cell->node_info->location); data/repmgr-5.2.0/repmgr-action-cluster.c:252:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(cell->node_info->replication_info->timeline_id_str, _("n/a"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:254:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_show[SHOW_TIMELINE_ID].cur_length = strlen(cell->node_info->replication_info->timeline_id_str); data/repmgr-5.2.0/repmgr-action-cluster.c:256: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). headers_show[SHOW_CONNINFO].cur_length = strlen(cell->node_info->conninfo); data/repmgr-5.2.0/repmgr-action-cluster.c:427:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_event[EV_NODE_ID].title, _("Node ID"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:428:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_event[EV_NODE_NAME].title, _("Name"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:429:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_event[EV_EVENT].title, _("Event"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:430:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_event[EV_SUCCESS].title, _("OK"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:431:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_event[EV_TIMESTAMP].title, _("Timestamp"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:432:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_event[EV_DETAILS].title, _("Details"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:444: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). headers_event[i].max_length = strlen(headers_event[i].title); data/repmgr-5.2.0/repmgr-action-cluster.c:453:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_event[j].cur_length = strlen(PQgetvalue(res, i, j)); data/repmgr-5.2.0/repmgr-action-cluster.c:589:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_crosscheck[0].title, _("Name"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:590:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_crosscheck[1].title, _("ID"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:602: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). headers_crosscheck[i].max_length = strlen(headers_crosscheck[i].title); data/repmgr-5.2.0/repmgr-action-cluster.c:614:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(cube[i]->node_name) > headers_crosscheck[0].max_length) data/repmgr-5.2.0/repmgr-action-cluster.c:616: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). headers_crosscheck[0].max_length = strlen(cube[i]->node_name); data/repmgr-5.2.0/repmgr-action-cluster.c:780:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_matrix[0].title, _("Name"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:781:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_matrix[1].title, _("ID"), MAXLEN); data/repmgr-5.2.0/repmgr-action-cluster.c:793: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). headers_matrix[i].max_length = strlen(headers_matrix[i].title); data/repmgr-5.2.0/repmgr-action-cluster.c:806:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(matrix_rec_list[i]->node_name) > headers_matrix[0].max_length) data/repmgr-5.2.0/repmgr-action-cluster.c:808:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_matrix[0].max_length = strlen(matrix_rec_list[i]->node_name); data/repmgr-5.2.0/repmgr-action-cluster.c:922:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(config_file_options.conninfo)) data/repmgr-5.2.0/repmgr-action-cluster.c:967:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(matrix_rec_list[i]->node_name, data/repmgr-5.2.0/repmgr-action-cluster.c:1151:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(config_file_options.conninfo)) data/repmgr-5.2.0/repmgr-action-cluster.c:1188:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cube[h]->node_name, cell->node_info->node_name, sizeof(cube[h]->node_name)); data/repmgr-5.2.0/repmgr-action-node.c:103:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(data_dir, config_file_options.data_directory, MAXPGPATH); data/repmgr-5.2.0/repmgr-action-node.c:117:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(cluster_size, _("unknown"), MAXLEN); data/repmgr-5.2.0/repmgr-action-node.c:1009:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(cell->details)) data/repmgr-5.2.0/repmgr-action-node.c:1031:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(cell->details)) data/repmgr-5.2.0/repmgr-action-node.c:2973: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(follow_output.data)) data/repmgr-5.2.0/repmgr-action-node.c:3265: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). int config_file_len = strlen(runtime_options.config_files); data/repmgr-5.2.0/repmgr-action-node.c:3279:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(filenamebuf, runtime_options.config_files + i, filename_len); data/repmgr-5.2.0/repmgr-action-node.c:3302:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(filenamebuf, runtime_options.config_files + i, filename_len); data/repmgr-5.2.0/repmgr-action-node.c:3546:7: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). a = fgetc(ptr_old); data/repmgr-5.2.0/repmgr-action-service.c:75:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(config_file_options.conninfo)) data/repmgr-5.2.0/repmgr-action-service.c:90:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_ID].title, _("ID"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:91:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_NAME].title, _("Name"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:92:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_ROLE].title, _("Role"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:93:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_PG].title, _("Status"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:94:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_UPSTREAM_NAME].title, _("Upstream"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:97:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_LOCATION].title, _("Location"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:99:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_PRIORITY].title, _("Prio."), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:101:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_PRIORITY].title, _("Priority"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:103:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_REPMGRD].title, _("repmgrd"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:104:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_PID].title, _("PID"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:105:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_PAUSED].title, _("Paused?"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:108:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_UPSTREAM_LAST_SEEN].title, _("Upstr. last"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:110:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(headers_status[STATUS_UPSTREAM_LAST_SEEN].title, _("Upstream last seen"), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:114:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_status[i].max_length = strlen(headers_status[i].title); data/repmgr-5.2.0/repmgr-action-service.c:153:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(error, PQerrorMessage(cell->node_info->conn), MAXLEN); data/repmgr-5.2.0/repmgr-action-service.c:246: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). headers_status[STATUS_NAME].cur_length = strlen(cell->node_info->node_name); data/repmgr-5.2.0/repmgr-action-service.c:247: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). headers_status[STATUS_ROLE].cur_length = strlen(get_node_type_string(cell->node_info->type)); data/repmgr-5.2.0/repmgr-action-service.c:248: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). headers_status[STATUS_PG].cur_length = strlen(repmgrd_info[i]->pg_running_text); data/repmgr-5.2.0/repmgr-action-service.c:249:53: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_status[STATUS_UPSTREAM_NAME].cur_length = strlen(cell->node_info->upstream_node_name); data/repmgr-5.2.0/repmgr-action-service.c:255:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_status[STATUS_LOCATION].cur_length = strlen(cell->node_info->location); data/repmgr-5.2.0/repmgr-action-service.c:259:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_status[STATUS_PRIORITY].cur_length = strlen(buf.data); data/repmgr-5.2.0/repmgr-action-service.c:263: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). headers_status[STATUS_PID].cur_length = strlen(repmgrd_info[i]->pid_text); data/repmgr-5.2.0/repmgr-action-service.c:264:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). headers_status[STATUS_REPMGRD].cur_length = strlen(repmgrd_info[i]->repmgrd_running); data/repmgr-5.2.0/repmgr-action-service.c:266: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). headers_status[STATUS_UPSTREAM_LAST_SEEN].cur_length = strlen(repmgrd_info[i]->upstream_last_seen_text); data/repmgr-5.2.0/repmgr-action-service.c:409:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(config_file_options.conninfo)) data/repmgr-5.2.0/repmgr-action-standby.c:262: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(application_name) && strncmp(application_name, config_file_options.node_name, sizeof(config_file_options.node_name)) != 0) data/repmgr-5.2.0/repmgr-action-standby.c:378:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(recovery_conninfo_str, runtime_options.upstream_conninfo, MAXLEN); data/repmgr-5.2.0/repmgr-action-standby.c:1780:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(placeholder_upstream_node_record.conninfo, runtime_options.upstream_conninfo, MAXLEN); data/repmgr-5.2.0/repmgr-action-standby.c:3119: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( follow_output.data )) data/repmgr-5.2.0/repmgr-action-standby.c:3251:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(local_node_record.slot_name)) data/repmgr-5.2.0/repmgr-action-standby.c:3989: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(command_output.data) > 2) data/repmgr-5.2.0/repmgr-action-standby.c:3998: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(config_file_options.pg_bindir)) data/repmgr-5.2.0/repmgr-action-standby.c:4057: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(command_output.data) > 2) data/repmgr-5.2.0/repmgr-action-standby.c:4950:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(shutdown_command, command_output.data, MAXLEN); data/repmgr-5.2.0/repmgr-action-standby.c:5809:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(recovery_conninfo_str, upstream_node_record.conninfo, MAXLEN); data/repmgr-5.2.0/repmgr-action-standby.c:5810:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(upstream_repluser, upstream_node_record.repluser, NAMEDATALEN); data/repmgr-5.2.0/repmgr-action-standby.c:5815:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(upstream_user, upstream_conninfo_user, NAMEDATALEN); data/repmgr-5.2.0/repmgr-action-standby.c:6052:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(backup_options.wal_method) && strcmp(backup_options.wal_method, "stream") != 0) data/repmgr-5.2.0/repmgr-action-standby.c:6679: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(runtime_options.host)) data/repmgr-5.2.0/repmgr-action-standby.c:6684: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(runtime_options.port)) data/repmgr-5.2.0/repmgr-action-standby.c:6689: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(runtime_options.replication_user)) data/repmgr-5.2.0/repmgr-action-standby.c:6693: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). else if (strlen(upstream_repluser)) data/repmgr-5.2.0/repmgr-action-standby.c:6697: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). else if (strlen(node_record->repluser)) data/repmgr-5.2.0/repmgr-action-standby.c:6701: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). else if (strlen(runtime_options.username)) data/repmgr-5.2.0/repmgr-action-standby.c:6730: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(backup_options.wal_method)) data/repmgr-5.2.0/repmgr-action-standby.c:6758: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(backup_options.slot) || (strlen(backup_options.wal_method) && strcmp(backup_options.wal_method, "stream") != 0)) data/repmgr-5.2.0/repmgr-action-standby.c:6758: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 (strlen(backup_options.slot) || (strlen(backup_options.wal_method) && strcmp(backup_options.wal_method, "stream") != 0)) data/repmgr-5.2.0/repmgr-action-standby.c:7018:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(backup_id, p, n); data/repmgr-5.2.0/repmgr-action-standby.c:7569:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(config_file_options.barman_config)) data/repmgr-5.2.0/repmgr-action-standby.c:7612:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, p, i); data/repmgr-5.2.0/repmgr-action-standby.c:7620:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(oid, p, i); data/repmgr-5.2.0/repmgr-action-standby.c:7628:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(location, p, i); data/repmgr-5.2.0/repmgr-action-standby.c:7673:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dst, p, MAXLEN); data/repmgr-5.2.0/repmgr-action-standby.c:7774: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). cell->oid = pg_malloc(1 + strlen(oid)); data/repmgr-5.2.0/repmgr-action-standby.c:7775: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). cell->name = pg_malloc(1 + strlen(name)); data/repmgr-5.2.0/repmgr-action-standby.c:7776: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). cell->location = pg_malloc(1 + strlen(location)); data/repmgr-5.2.0/repmgr-action-standby.c:7778:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cell->oid, oid, 1 + strlen(oid)); data/repmgr-5.2.0/repmgr-action-standby.c:7778: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). strncpy(cell->oid, oid, 1 + strlen(oid)); data/repmgr-5.2.0/repmgr-action-standby.c:7779:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cell->name, name, 1 + strlen(name)); data/repmgr-5.2.0/repmgr-action-standby.c:7779: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). strncpy(cell->name, name, 1 + strlen(name)); data/repmgr-5.2.0/repmgr-action-standby.c:7780:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cell->location, location, 1 + strlen(location)); data/repmgr-5.2.0/repmgr-action-standby.c:7780: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). strncpy(cell->location, location, 1 + strlen(location)); data/repmgr-5.2.0/repmgr-action-standby.c:7991:7: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). um = umask((~(S_IRUSR | S_IWUSR)) & (S_IRWXG | S_IRWXO)); data/repmgr-5.2.0/repmgr-action-standby.c:7993:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(um); data/repmgr-5.2.0/repmgr-action-standby.c:8076: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(config_file_options.node_name)) data/repmgr-5.2.0/repmgr-action-standby.c:8526: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(node_status_output)) data/repmgr-5.2.0/repmgr-action-standby.c:8597: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(node_check_output)) data/repmgr-5.2.0/repmgr-action-standby.c:8666: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(node_check_output)) data/repmgr-5.2.0/repmgr-action-standby.c:8732: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(node_check_output)) data/repmgr-5.2.0/repmgr-action-standby.c:8790: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(node_check_output)) data/repmgr-5.2.0/repmgr-action-standby.c:8843: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(db_connection)) data/repmgr-5.2.0/repmgr-client.c:148:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.host, default_conninfo.values[c], MAXLEN); data/repmgr-5.2.0/repmgr-client.c:153:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.host, default_conninfo.values[c], MAXLEN); data/repmgr-5.2.0/repmgr-client.c:158:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.port, default_conninfo.values[c], MAXLEN); data/repmgr-5.2.0/repmgr-client.c:163:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.dbname, default_conninfo.values[c], MAXLEN); data/repmgr-5.2.0/repmgr-client.c:168:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.username, default_conninfo.values[c], MAXLEN); data/repmgr-5.2.0/repmgr-client.c:185:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.username, pw->pw_name, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:233:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.pg_bindir, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:238:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.config_file, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:253:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.replication_user, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:298:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.dbname, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:309:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.host, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:323:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.port, data/repmgr-5.2.0/repmgr-client.c:331:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.username, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:343:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.remote_user, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:348:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.superuser, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:358:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.data_dir, optarg, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:369: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(optarg) < sizeof(runtime_options.node_name)) data/repmgr-5.2.0/repmgr-client.c:370:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.node_name, optarg, sizeof(runtime_options.node_name)); data/repmgr-5.2.0/repmgr-client.c:430:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.upstream_conninfo, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:477:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.force_rewind_path, optarg, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:560:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.config_files, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:565:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.config_archive_dir, optarg, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:575:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.action, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:592:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.event, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:626:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.log_level, optarg, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:776:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.host, opt->val, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:782:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.host, opt->val, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:788:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.port, opt->val, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:793:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.username, opt->val, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:1065:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.host, argv[optind++], MAXLEN); data/repmgr-5.2.0/repmgr-client.c:1183:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_file_options.log_level, runtime_options.log_level, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:1190: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(runtime_options.pg_bindir)) data/repmgr-5.2.0/repmgr-client.c:1192:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(runtime_options.pg_bindir, config_file_options.pg_bindir, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:1196:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(runtime_options.pg_bindir)) data/repmgr-5.2.0/repmgr-client.c:1198:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(runtime_options.pg_bindir); data/repmgr-5.2.0/repmgr-client.c:1206:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pg_bindir, runtime_options.pg_bindir, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:1286: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(config_file_options.conninfo)) data/repmgr-5.2.0/repmgr-client.c:1526: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(config_file_options.config_directory)) data/repmgr-5.2.0/repmgr-client.c:2890:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(server_version_string, version_string, MAXVERSIONSTR); data/repmgr-5.2.0/repmgr-client.c:3200:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(config_file_options.repmgr_bindir); data/repmgr-5.2.0/repmgr-client.c:3241:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(config_file_options.repmgr_bindir); data/repmgr-5.2.0/repmgr-client.c:3305:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(script, command.data, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3343:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(script, command.data, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3373:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(script, command.data, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3403:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(script, command.data, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3434:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(script, command.data, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3514:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_dir_buf, config_file_options.config_directory, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:3520:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_dir_buf, config_file_options.data_directory, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:3537:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(data_dir_buf, config_file_options.data_directory, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:3543:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(data_dir_buf, runtime_options.data_dir, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:3564:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(node_record->location, config_file_options.location, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3566:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(node_record->location, "default", MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3569:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(node_record->node_name, config_file_options.node_name, sizeof(node_record->node_name)); data/repmgr-5.2.0/repmgr-client.c:3570:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(node_record->conninfo, config_file_options.conninfo, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:3571:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(node_record->config_file, config_file_path, MAXPGPATH); data/repmgr-5.2.0/repmgr-client.c:3576:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(node_record->repluser, config_file_options.replication_user, NAMEDATALEN); data/repmgr-5.2.0/repmgr-client.c:3584:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(node_record->repluser, repluser, NAMEDATALEN); data/repmgr-5.2.0/repmgr-client.c:3665:7: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). um = umask((~(S_IRUSR | S_IWUSR)) & (S_IRWXG | S_IRWXO)); data/repmgr-5.2.0/repmgr-client.c:3667:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(um); data/repmgr-5.2.0/repmgr-client.c:4420:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(conf_owner, pw->pw_name, MAXLEN); data/repmgr-5.2.0/repmgr-client.c:4433:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dir_owner, pw->pw_name, MAXLEN); data/repmgr-5.2.0/repmgr.c:588:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(repmgrd_pidfile, shared_state->repmgrd_pidfile, MAXPGPATH); data/repmgr-5.2.0/repmgr.c:630:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(shared_state->repmgrd_pidfile, repmgrd_pidfile, MAXPGPATH); data/repmgr-5.2.0/repmgr.c:708: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). if (fwrite(buf.data, strlen(buf.data) + 1, 1, file) != 1) data/repmgr-5.2.0/repmgrd-physical.c:5346: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). dst_ptr += strlen(dst_ptr); data/repmgr-5.2.0/repmgrd.c:183:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pid_file, optarg, MAXPGPATH); data/repmgr-5.2.0/repmgrd.c:203:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cli_log_level, optarg, MAXLEN); data/repmgr-5.2.0/repmgrd.c:269:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pid_file, config_file_options.repmgrd_pid_file, MAXPGPATH); data/repmgr-5.2.0/repmgrd.c:318:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config_file_options.log_level, cli_log_level, MAXLEN); data/repmgr-5.2.0/repmgrd.c:650:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (ptr = config_file_path + strlen(config_file_path); ptr > config_file_path; --ptr) data/repmgr-5.2.0/repmgrd.c:654:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, config_file_path, ptr - config_file_path); data/repmgr-5.2.0/strutil.c:247: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). keylen = strlen(key); data/repmgr-5.2.0/strutil.c:248: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). vallen = strlen(value); data/repmgr-5.2.0/strutil.c:254:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cell->key, key, keylen); data/repmgr-5.2.0/strutil.c:255:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cell->value, value, vallen); data/repmgr-5.2.0/strutil.c:328: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). itemlen = strlen(item); data/repmgr-5.2.0/strutil.c:334:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cell->item, item, itemlen); data/repmgr-5.2.0/strutil.c:459: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). n = strlen(prefix); data/repmgr-5.2.0/strutil.c:473: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). n = strlen(string) - 1; data/repmgr-5.2.0/strutil.c:487: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). *s2 = &s[strlen(s) - 1]; data/repmgr-5.2.0/strutil.c:543: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). dst_ptr += strlen(dst_ptr); ANALYSIS SUMMARY: Hits = 623 Lines analyzed = 42568 in approximately 1.01 seconds (42323 lines/second) Physical Source Lines of Code (SLOC) = 29374 Hits@level = [0] 458 [1] 287 [2] 277 [3] 13 [4] 42 [5] 4 Hits@level+ = [0+] 1081 [1+] 623 [2+] 336 [3+] 59 [4+] 46 [5+] 4 Hits/KSLOC@level+ = [0+] 36.8013 [1+] 21.2092 [2+] 11.4387 [3+] 2.00858 [4+] 1.56601 [5+] 0.136175 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.