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/pglogical-2.3.3/compat10/pglogical_compat.c Examining data/pglogical-2.3.3/compat10/pglogical_compat.h Examining data/pglogical-2.3.3/compat11/pglogical_compat.c Examining data/pglogical-2.3.3/compat11/pglogical_compat.h Examining data/pglogical-2.3.3/compat12/pglogical_compat.c Examining data/pglogical-2.3.3/compat12/pglogical_compat.h Examining data/pglogical-2.3.3/compat13/pglogical_compat.c Examining data/pglogical-2.3.3/compat13/pglogical_compat.h Examining data/pglogical-2.3.3/compat94/access/commit_ts.h Examining data/pglogical-2.3.3/compat94/access/stratnum.h Examining data/pglogical-2.3.3/compat94/pglogical_compat.c Examining data/pglogical-2.3.3/compat94/pglogical_compat.h Examining data/pglogical-2.3.3/compat94/replication/origin.h Examining data/pglogical-2.3.3/compat95/pglogical_compat.c Examining data/pglogical-2.3.3/compat95/pglogical_compat.h Examining data/pglogical-2.3.3/compat96/pglogical_compat.c Examining data/pglogical-2.3.3/compat96/pglogical_compat.h Examining data/pglogical-2.3.3/pglogical.c Examining data/pglogical-2.3.3/pglogical.h Examining data/pglogical-2.3.3/pglogical_apply.c Examining data/pglogical-2.3.3/pglogical_apply.h Examining data/pglogical-2.3.3/pglogical_apply_heap.c Examining data/pglogical-2.3.3/pglogical_apply_heap.h Examining data/pglogical-2.3.3/pglogical_apply_spi.c Examining data/pglogical-2.3.3/pglogical_apply_spi.h Examining data/pglogical-2.3.3/pglogical_conflict.c Examining data/pglogical-2.3.3/pglogical_conflict.h Examining data/pglogical-2.3.3/pglogical_create_subscriber.c Examining data/pglogical-2.3.3/pglogical_dependency.c Examining data/pglogical-2.3.3/pglogical_dependency.h Examining data/pglogical-2.3.3/pglogical_dump/common.c Examining data/pglogical-2.3.3/pglogical_dump/compat.h Examining data/pglogical-2.3.3/pglogical_dump/compress_io.c Examining data/pglogical-2.3.3/pglogical_dump/compress_io.h Examining data/pglogical-2.3.3/pglogical_dump/dumputils.c Examining data/pglogical-2.3.3/pglogical_dump/dumputils.h Examining data/pglogical-2.3.3/pglogical_dump/keywords.c Examining data/pglogical-2.3.3/pglogical_dump/kwlookup.c Examining data/pglogical-2.3.3/pglogical_dump/parallel.c Examining data/pglogical-2.3.3/pglogical_dump/parallel.h Examining data/pglogical-2.3.3/pglogical_dump/pg_backup.h Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.h Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_db.h Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_null.c Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.h Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_utils.c Examining data/pglogical-2.3.3/pglogical_dump/pg_backup_utils.h Examining data/pglogical-2.3.3/pglogical_dump/pg_dump.c Examining data/pglogical-2.3.3/pglogical_dump/pg_dump.h Examining data/pglogical-2.3.3/pglogical_dump/pg_dump_sort.c Examining data/pglogical-2.3.3/pglogical_dump/pgtar.h Examining data/pglogical-2.3.3/pglogical_dump/tar.c Examining data/pglogical-2.3.3/pglogical_executor.c Examining data/pglogical-2.3.3/pglogical_executor.h Examining data/pglogical-2.3.3/pglogical_fe.c Examining data/pglogical-2.3.3/pglogical_fe.h Examining data/pglogical-2.3.3/pglogical_functions.c Examining data/pglogical-2.3.3/pglogical_manager.c Examining data/pglogical-2.3.3/pglogical_monitoring.c Examining data/pglogical-2.3.3/pglogical_node.c Examining data/pglogical-2.3.3/pglogical_node.h Examining data/pglogical-2.3.3/pglogical_output.c Examining data/pglogical-2.3.3/pglogical_output_config.c Examining data/pglogical-2.3.3/pglogical_output_config.h Examining data/pglogical-2.3.3/pglogical_output_plugin.c Examining data/pglogical-2.3.3/pglogical_output_plugin.h Examining data/pglogical-2.3.3/pglogical_output_proto.c Examining data/pglogical-2.3.3/pglogical_output_proto.h Examining data/pglogical-2.3.3/pglogical_proto_json.c Examining data/pglogical-2.3.3/pglogical_proto_json.h Examining data/pglogical-2.3.3/pglogical_proto_native.c Examining data/pglogical-2.3.3/pglogical_proto_native.h Examining data/pglogical-2.3.3/pglogical_queue.c Examining data/pglogical-2.3.3/pglogical_queue.h Examining data/pglogical-2.3.3/pglogical_relcache.c Examining data/pglogical-2.3.3/pglogical_relcache.h Examining data/pglogical-2.3.3/pglogical_repset.c Examining data/pglogical-2.3.3/pglogical_repset.h Examining data/pglogical-2.3.3/pglogical_rpc.c Examining data/pglogical-2.3.3/pglogical_rpc.h Examining data/pglogical-2.3.3/pglogical_sequences.c Examining data/pglogical-2.3.3/pglogical_sync.c Examining data/pglogical-2.3.3/pglogical_sync.h Examining data/pglogical-2.3.3/pglogical_worker.c Examining data/pglogical-2.3.3/pglogical_worker.h FINAL RESULTS: data/pglogical-2.3.3/pglogical.c:451:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(remote_sysid, UINT64_FORMAT, sysid) != 1) data/pglogical-2.3.3/pglogical.c:863:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(bgw.bgw_library_name, BGW_MAXLEN, data/pglogical-2.3.3/pglogical_conflict.c:664:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(local_tup_ts_str, data/pglogical-2.3.3/pglogical_create_subscriber.c:622:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, argptr); data/pglogical-2.3.3/pglogical_create_subscriber.c:651: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(stdout, fmt, argptr); data/pglogical-2.3.3/pglogical_create_subscriber.c:678: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. ret = system(cmd->data); data/pglogical-2.3.3/pglogical_create_subscriber.c:714: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. ret = system(cmd->data); data/pglogical-2.3.3/pglogical_create_subscriber.c:1337:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(res, 33, UINT64_FORMAT, ControlFile.system_identifier); data/pglogical-2.3.3/pglogical_create_subscriber.c:1351:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/postgresql.auto.conf", data_dir); data/pglogical-2.3.3/pglogical_create_subscriber.c:1355:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/recovery.conf", data_dir); data/pglogical-2.3.3/pglogical_create_subscriber.c:1374:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/standby.signal", data_dir); data/pglogical-2.3.3/pglogical_create_subscriber.c:1394:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename, "%s/%s", data_dir, tofile); data/pglogical-2.3.3/pglogical_dump/dumputils.c:1224:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cell->val, val); data/pglogical-2.3.3/pglogical_dump/parallel.c:221:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf + strlen("ERROR "), data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:463:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(line, "%u %s\n", &oid, fname) != 2) data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:721:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(buf, dname); data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:723:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, relativeFilename); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:963:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fname, "blob_%u.dat%s", oid, sfx); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1108:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf1, sizeof(buf1), INT64_FORMAT, (int64) len); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1109:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf2, sizeof(buf2), INT64_FORMAT, (int64) th->fileLen); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1145:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf1, sizeof(buf1), INT64_FORMAT, (int64) ctx->tarFHpos); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1146:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf2, sizeof(buf2), INT64_FORMAT, (int64) ctx->tarNextMember); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1157:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, sizeof(buf), INT64_FORMAT, (int64) ctx->tarFHpos); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1270:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, (uint64) hPos); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1271:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(lenbuf, sizeof(lenbuf), UINT64_FORMAT, (uint64) len); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1280:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(posbuf, sizeof(posbuf), UINT64_FORMAT, data/pglogical-2.3.3/pglogical_dump/pg_backup_utils.c:93:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, _(fmt), ap); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:14312:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(bufm, sizeof(bufm), INT64_FORMAT, SEQ_MINVALUE); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:14313:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(bufx, sizeof(bufx), INT64_FORMAT, SEQ_MAXVALUE); data/pglogical-2.3.3/pglogical_executor.c:303:42: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. pglogical_object_access(ObjectAccessType access, data/pglogical-2.3.3/pglogical_executor.c:310:31: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. (*next_object_access_hook) (access, classId, objectId, subId, arg); data/pglogical-2.3.3/pglogical_fe.c:45:16: [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. if ((output = popen(cmd, "r")) == NULL) data/pglogical-2.3.3/pglogical_functions.c:1935:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(sysid, sizeof(sysid), UINT64_FORMAT, data/pglogical-2.3.3/pglogical_output_plugin.c:1001:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path, "pg_replslot/%s", slotname); data/pglogical-2.3.3/pglogical_sync.c:120: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. res = system(command.data); data/pglogical-2.3.3/pglogical_sync.c:152: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. res = system(command.data); data/pglogical-2.3.3/pglogical_worker.c:148:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(bgw.bgw_library_name, BGW_MAXLEN, data/pglogical-2.3.3/pglogical.c:731:24: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char *tmpdir = getenv("TMPDIR"); data/pglogical-2.3.3/pglogical_create_subscriber.c:229: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, "D:n:sv", long_options, &optindex)) != -1) data/pglogical-2.3.3/pglogical_create_subscriber.c:329: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/pglogical-2.3.3/pglogical_create_subscriber.c:1788:66: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. snprintf(rpn, NAMEDATALEN-1, "pglogical_create_subscriber_%lx", random()); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:406: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, "abcCd:E:f:F:h:ij:n:N:oOp:RsS:t:T:U:vwWxZ:", data/pglogical-2.3.3/pglogical.c:270: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 *keys[CONN_PARAM_ARRAY_SIZE]; data/pglogical-2.3.3/pglogical.c:271: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 *vals[CONN_PARAM_ARRAY_SIZE]; data/pglogical-2.3.3/pglogical.c:285: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 s[NAMEDATALEN]; data/pglogical-2.3.3/pglogical.c:736: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 tmpdir[MAXPGPATH]; data/pglogical-2.3.3/pglogical_apply.c:1628:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sync, lfirst(lc), sizeof(PGLogicalSyncStatus)); data/pglogical-2.3.3/pglogical_apply.c:1695:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sync, newsync, sizeof(PGLogicalSyncStatus)); data/pglogical-2.3.3/pglogical_apply.c:1823: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(&worker.worker.sync.nspname, nspname, sizeof(NameData)); data/pglogical-2.3.3/pglogical_apply.c:1824: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(&worker.worker.sync.relname, relname, sizeof(NameData)); data/pglogical-2.3.3/pglogical_apply_spi.c:68:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const char BinarySignature[11] = "PGCOPY\n\377\r\n\0"; data/pglogical-2.3.3/pglogical_apply_spi.c:112:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nulls[MaxTupleAttributeNumber]; data/pglogical-2.3.3/pglogical_apply_spi.c:179:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nulls[MaxTupleAttributeNumber]; data/pglogical-2.3.3/pglogical_apply_spi.c:257:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nulls[MaxTupleAttributeNumber]; data/pglogical-2.3.3/pglogical_apply_spi.c:452:31: [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). pglcstate->copy_write_file = fopen(FilePathName(pglcstate->copy_file), "w"); data/pglogical-2.3.3/pglogical_apply_spi.c:453:30: [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). pglcstate->copy_read_file = fopen(FilePathName(pglcstate->copy_file), "r"); data/pglogical-2.3.3/pglogical_conflict.c:656:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char local_tup_ts_str[MAXDATELEN] = "(unset)"; data/pglogical-2.3.3/pglogical_conflict.c:846:4: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(&outputstr[MAX_CONFLICT_LOG_ATTR_LEN-5], "..."); data/pglogical-2.3.3/pglogical_create_subscriber.c:72: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 pid_file[MAXPGPATH]; data/pglogical-2.3.3/pglogical_create_subscriber.c:279: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). apply_delay = atoi(optarg); data/pglogical-2.3.3/pglogical_create_subscriber.c:372:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). logfd = open("pglogical_create_subscriber_postgres.log", O_CREAT | O_RDWR, data/pglogical-2.3.3/pglogical_create_subscriber.c:1322:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/pglogical-2.3.3/pglogical_create_subscriber.c:1327: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/pglogical-2.3.3/pglogical_create_subscriber.c:1347:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/pglogical-2.3.3/pglogical_create_subscriber.c:1353: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). cf = fopen(filename, "a"); data/pglogical-2.3.3/pglogical_create_subscriber.c:1357: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). cf = fopen(filename, "w"); data/pglogical-2.3.3/pglogical_create_subscriber.c:1375: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). cf = fopen(filename, "w"); data/pglogical-2.3.3/pglogical_create_subscriber.c:1392:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/pglogical-2.3.3/pglogical_create_subscriber.c:1596:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char version_file[MAXPGPATH]; data/pglogical-2.3.3/pglogical_create_subscriber.c:1629:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). srcfd = open(fromfile, O_RDONLY | PG_BINARY, 0); data/pglogical-2.3.3/pglogical_create_subscriber.c:1633:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dstfd = open(tofile, O_RDWR | O_CREAT | (append ? O_APPEND : O_TRUNC) | PG_BINARY, data/pglogical-2.3.3/pglogical_create_subscriber.c:1681: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 full_path[MAXPGPATH]; data/pglogical-2.3.3/pglogical_create_subscriber.c:1700: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 full_path[MAXPGPATH]; data/pglogical-2.3.3/pglogical_create_subscriber.c:1746: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/pglogical-2.3.3/pglogical_dependency.c:773: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). my_client_min_messages = atoi(GetConfigOptionByName("client_min_messages", data/pglogical-2.3.3/pglogical_dependency.c:775: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). my_log_min_messages = atoi(GetConfigOptionByName("log_min_messages", data/pglogical-2.3.3/pglogical_dump/common.c:820:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char temp[100]; data/pglogical-2.3.3/pglogical_dump/compress_io.c:552: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 mode_compression[32]; data/pglogical-2.3.3/pglogical_dump/compress_io.c:579:24: [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->uncompressedfp = fopen(path, mode); data/pglogical-2.3.3/pglogical_dump/dumputils.h:26:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char val[1]; /* VARIABLE LENGTH FIELD */ data/pglogical-2.3.3/pglogical_dump/kwlookup.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 word[NAMEDATALEN]; data/pglogical-2.3.3/pglogical_dump/parallel.c:97: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 *getMessageFromMaster(int pipefd[2]); data/pglogical-2.3.3/pglogical_dump/parallel.c: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 buf[512]; data/pglogical-2.3.3/pglogical_dump/parallel.c:220:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "ERROR "); data/pglogical-2.3.3/pglogical_dump/parallel.c:1098: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 * data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:445: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. char buffer[40]; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:480:10: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buffer, "DROP CONSTRAINT"); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:942:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(newToc->dependencies, deps, nDeps * sizeof(DumpId)); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1183:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1191: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). fh = fopen(ropt->tocFile, PG_BINARY_R); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1338: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 fmode[10]; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1341:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(fmode, "wb%d", compression); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1356:14: [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). AH->OF = fopen(filename, PG_BINARY_A); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1363:14: [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). AH->OF = fopen(filename, PG_BINARY_W); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1526:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *) AH->lo_buf + AH->lo_buf_used, ptr, avail); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1533:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *) AH->lo_buf + AH->lo_buf_used, ptr, remaining); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1899:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sig[6]; /* More than enough */ data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1927:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1954: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). fh = fopen(AH->fSpec, PG_BINARY_R); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2282:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char workbuf[32]; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2307:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(workbuf, "%u", te->catalogId.tableoid); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2309:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(workbuf, "%u", te->catalogId.oid); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2326:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(workbuf, "%d", te->dependencies[i]); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:3328:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpMag[7]; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:3461:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:4259: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(clone, AH, sizeof(ArchiveHandle)); data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:159:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). AH->FH = fopen(AH->fSpec, PG_BINARY_W); data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:178:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). AH->FH = fopen(AH->fSpec, PG_BINARY_R); data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:767:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). AH->FH = fopen(AH->fSpec, PG_BINARY_R); data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:786: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(AH->formatData, ctx, sizeof(lclContext)); data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:848:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[64]; /* short fixed-size string + number */ data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:141: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 *keywords[7]; data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:142: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[7]; data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:254: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 *keywords[7]; data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:255: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[7]; data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:325:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[1]; data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:399:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char errStmt[DB_MAX_ERR_STMT]; data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:560:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(str, buf, bufLen); data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:205: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 fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:244:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fn[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:334:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:431: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 fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:443:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:444:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char line[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:459: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 fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:460:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:576:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:637:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:657:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAXPGPATH]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:677:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[50]; data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:735: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(AH->formatData, ctx, sizeof(lclContext)); data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:771:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[64]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:180:17: [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). ctx->tarFH = fopen(AH->fSpec, PG_BINARY_W); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:218:17: [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). ctx->tarFH = fopen(AH->fSpec, PG_BINARY_R); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:262:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fn[K_STD_BUF_SIZE]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:269:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(fn, "%d.dat", te->dumpId); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:271:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(fn, "%d.dat.gz", te->dumpId); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:273:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(fn, "%d.dat", te->dumpId); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:340:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fmode[10]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:389:15: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). tm->tmpFH = tmpfile(); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:405:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(name, O_RDWR | O_CREAT | O_EXCL | O_BINARY | data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:428:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(fmode, "wb%d", AH->compression); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:538:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, AH->lookahead + AH->lookaheadPos, used); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:550:19: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. res = fread(&((char *) buf)[used], 1, len, fh); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:558:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. res = GZREAD(&((char *) buf)[used], 1, len, th->zFH); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:565:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. res = fread(&((char *) buf)[used], 1, len, th->nFH); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:639:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4096]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:725:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[4096]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:873:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ropt, AH->ropt, sizeof(RestoreOptions)); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:934:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[K_STD_BUF_SIZE]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:936:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(fname, "blobs.toc"); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:952:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[255]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1071:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[32768]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1105: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 buf1[32], data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1131:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char header[512]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1142: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 buf1[100], data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1155: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[100]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1183:8: [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). id = atoi(th->targetFile); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1211:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char h[512]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1212:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tag[100 + 1]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1267: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 posbuf[32]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1268: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 lenbuf[32]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1278: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 posbuf[32]; data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:1298:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char h[512]; data/pglogical-2.3.3/pglogical_dump/pg_dump.c:122: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 g_opaque_type[10]; /* name for the opaque type */ data/pglogical-2.3.3/pglogical_dump/pg_dump.c:125: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 g_comment_start[10]; data/pglogical-2.3.3/pglogical_dump/pg_dump.c:126: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 g_comment_end[10]; data/pglogical-2.3.3/pglogical_dump/pg_dump.c:378:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(g_comment_start, "-- "); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:380:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(g_opaque_type, "opaque"); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:452: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). numWorkers = atoi(optarg); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:518:21: [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). compressLevel = atoi(optarg); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2421: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). atoi(PQgetvalue(lo_res, 0, i_relfrozenxid)), data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2422: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). atoi(PQgetvalue(lo_res, 0, i_relminmxid)), data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2461: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). atoi(PQgetvalue(lo_res, 0, i_relfrozenxid)), data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2462: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). atoi(PQgetvalue(lo_res, 0, i_relminmxid)), data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2738:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[LOBBUFSIZE]; data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4081:28: [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). agginfo[i].aggfn.nargs = atoi(PQgetvalue(res, i, i_pronargs)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4243:20: [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). finfo[i].nargs = atoi(PQgetvalue(res, i, i_pronargs)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4810: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). tblinfo[i].relpages = atoi(PQgetvalue(res, i, i_relpages)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4820: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). tblinfo[i].ncheck = atoi(PQgetvalue(res, i, i_relchecks)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4829:28: [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). tblinfo[i].owning_col = atoi(PQgetvalue(res, i, i_owning_col)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:5287: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). indxinfo[j].indnkeys = atoi(PQgetvalue(res, j, i_indnkeys)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:5305: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). indxinfo[j].relpages = atoi(PQgetvalue(res, j, i_relpages)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:5879: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). tginfo[j].tgtype = atoi(PQgetvalue(res, j, i_tgtype)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:5880: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). tginfo[j].tgnargs = atoi(PQgetvalue(res, j, i_tgnargs)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:6534: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). if (j + 1 != atoi(PQgetvalue(res, j, i_attnum))) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:6540: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). tbinfo->atttypmod[j] = atoi(PQgetvalue(res, j, i_atttypmod)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:6541: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). tbinfo->attstattarget[j] = atoi(PQgetvalue(res, j, i_attstattarget)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:6545: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). tbinfo->attlen[j] = atoi(PQgetvalue(res, j, i_attlen)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:6618: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). adnum = atoi(PQgetvalue(res, j, 2)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:7817:26: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). comments[i].objsubid = atoi(PQgetvalue(res, i, i_objsubid)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:9330:8: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (atoi(PQgetvalue(res, i, i_attnum)) == comments->objsubid) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:10683:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char query[128]; data/pglogical-2.3.3/pglogical_dump/pg_dump.c:13039: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). labels[i].objsubid = atoi(PQgetvalue(res, i, i_objsubid)); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:14302:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bufm[100], data/pglogical-2.3.3/pglogical_dump/pg_dump.h:493: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 g_comment_start[10]; data/pglogical-2.3.3/pglogical_dump/pg_dump.h:494: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 g_comment_end[10]; data/pglogical-2.3.3/pglogical_dump/pg_dump.h:496: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 g_opaque_type[10]; /* name for the opaque type */ data/pglogical-2.3.3/pglogical_dump/pg_dump_sort.c:399: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(objs, ordering, numObjs * sizeof(DumpableObject *)); data/pglogical-2.3.3/pglogical_dump/pg_dump_sort.c:1263:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/pglogical-2.3.3/pglogical_dump/tar.c:173:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(&h[257], "ustar"); data/pglogical-2.3.3/pglogical_dump/tar.c:176: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(&h[263], "00", 2); data/pglogical-2.3.3/pglogical_fe.c:25:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd[MAXPGPATH]; data/pglogical-2.3.3/pglogical_fe.c:26:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char cmd_output[1024]; data/pglogical-2.3.3/pglogical_functions.c:459:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&originif, existingif, sizeof(PGlogicalInterface)); data/pglogical-2.3.3/pglogical_functions.c:1924:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sysid[32]; data/pglogical-2.3.3/pglogical_output_plugin.c:999:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MAXPGPATH * 2 + 12]; data/pglogical-2.3.3/pglogical_proto_json.c:399:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXDATELEN + 1]; data/pglogical-2.3.3/pglogical_proto_json.c:419:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXDATELEN + 1]; data/pglogical-2.3.3/pglogical_proto_json.c:441:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MAXDATELEN + 1]; data/pglogical-2.3.3/pglogical_rpc.c:192: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 *values[1]; data/pglogical-2.3.3/pglogical_rpc.c:242: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 *values[1]; data/pglogical-2.3.3/pglogical_rpc.c:328: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 *values[2]; data/pglogical-2.3.3/pglogical_sync.c:92:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_dump[MAXPGPATH]; data/pglogical-2.3.3/pglogical_sync.c:133:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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_restore[MAXPGPATH]; data/pglogical-2.3.3/pglogical_sync.c:704:13: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if (unlink(tmpfile) != 0 && errno != ENOENT) data/pglogical-2.3.3/pglogical_sync.c:706:5: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). tmpfile); data/pglogical-2.3.3/pglogical_sync.c:780: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 tmpfile[MAXPGPATH]; data/pglogical-2.3.3/pglogical_sync.c:780:9: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). char tmpfile[MAXPGPATH]; data/pglogical-2.3.3/pglogical_sync.c:782:13: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). snprintf(tmpfile, MAXPGPATH, "%s/pglogical-%d.dump", data/pglogical-2.3.3/pglogical_sync.c:784:22: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). canonicalize_path(tmpfile); data/pglogical-2.3.3/pglogical_sync.c:787:26: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). CStringGetDatum(tmpfile)); data/pglogical-2.3.3/pglogical_sync.c:820:26: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). dump_structure(sub, tmpfile, snapshot); data/pglogical-2.3.3/pglogical_sync.c:823:29: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). restore_structure(sub, tmpfile, "pre-data"); data/pglogical-2.3.3/pglogical_sync.c:889:29: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). restore_structure(sub, tmpfile, "post-data"); data/pglogical-2.3.3/pglogical_sync.c:893:27: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). CStringGetDatum(tmpfile)); data/pglogical-2.3.3/pglogical_sync.c:895:30: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). CStringGetDatum(tmpfile)); data/pglogical-2.3.3/pglogical_worker.c:136: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(worker_shm, worker, sizeof(PGLogicalWorker)); data/pglogical-2.3.3/pglogical_worker.c:672: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). nworkers = atoi(GetConfigOptionByName("max_worker_processes", NULL, data/pglogical-2.3.3/pglogical_worker.c:704: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). nworkers = atoi(GetConfigOptionByName("max_worker_processes", NULL, data/pglogical-2.3.3/pglogical.c:120:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(str); data/pglogical-2.3.3/pglogical.c:190:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). inputlen = strlen(atext); data/pglogical-2.3.3/pglogical.c:288:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). shorten_hash(appname, NAMEDATALEN - strlen(suffix) - 2), data/pglogical-2.3.3/pglogical.c:474:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(NameStr(**dbname), remote_dbname, NAMEDATALEN); data/pglogical-2.3.3/pglogical.c:724: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(newval)) data/pglogical-2.3.3/pglogical_apply.c:722: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(k) == 0) data/pglogical-2.3.3/pglogical_conflict.c:843: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(outputstr) > MAX_CONFLICT_LOG_ATTR_LEN) data/pglogical-2.3.3/pglogical_create_subscriber.c:314:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!base_prov_connstr || !strlen(base_prov_connstr)) data/pglogical-2.3.3/pglogical_create_subscriber.c:316: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). if (!base_sub_connstr || !strlen(base_sub_connstr)) data/pglogical-2.3.3/pglogical_create_subscriber.c:325: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). if (!replication_sets || !strlen(replication_sets)) data/pglogical-2.3.3/pglogical_create_subscriber.c:360: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). if (!prov_connstr || !strlen(prov_connstr)) data/pglogical-2.3.3/pglogical_create_subscriber.c:364:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!sub_connstr || !strlen(sub_connstr)) data/pglogical-2.3.3/pglogical_create_subscriber.c:390: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). if (!prov_connstr || !strlen(prov_connstr)) data/pglogical-2.3.3/pglogical_create_subscriber.c:500:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!sub_connstr || !strlen(sub_connstr)) data/pglogical-2.3.3/pglogical_create_subscriber.c:804: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). PQescapeLiteral(conn, dbname, strlen(dbname)), data/pglogical-2.3.3/pglogical_create_subscriber.c:806: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). strlen(provider_node_name)), data/pglogical-2.3.3/pglogical_create_subscriber.c:808: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). strlen(subscription_name))); data/pglogical-2.3.3/pglogical_create_subscriber.c:822:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). PQescapeLiteral(conn, slot_name, strlen(slot_name))); data/pglogical-2.3.3/pglogical_create_subscriber.c:843: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). PQescapeLiteral(conn, slot_name, strlen(slot_name))); data/pglogical-2.3.3/pglogical_create_subscriber.c:856:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). PQescapeLiteral(conn, slot_name, strlen(slot_name)), data/pglogical-2.3.3/pglogical_create_subscriber.c:921: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). PQescapeLiteral(conn, extname, strlen(extname))); data/pglogical-2.3.3/pglogical_create_subscriber.c:948: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). PQescapeIdentifier(conn, extname, strlen(extname))); data/pglogical-2.3.3/pglogical_create_subscriber.c:1006: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). PQescapeLiteral(conn, origin_name, strlen(origin_name))); data/pglogical-2.3.3/pglogical_create_subscriber.c:1021:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). PQescapeLiteral(conn, origin_name, strlen(origin_name)), data/pglogical-2.3.3/pglogical_create_subscriber.c:1038: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). PQescapeLiteral(conn, origin_name, strlen(origin_name)), data/pglogical-2.3.3/pglogical_create_subscriber.c:1039:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). remote_lsn ? PQescapeLiteral(conn, remote_lsn, strlen(remote_lsn)) : "0"); data/pglogical-2.3.3/pglogical_create_subscriber.c:1094: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). PQescapeLiteral(conn, subscriber_name, strlen(subscriber_name)), data/pglogical-2.3.3/pglogical_create_subscriber.c:1095:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). PQescapeLiteral(conn, subscriber_dsn, strlen(subscriber_dsn))); data/pglogical-2.3.3/pglogical_create_subscriber.c:1117: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). PQescapeLiteral(conn, subscriber_name, strlen(subscriber_name)), data/pglogical-2.3.3/pglogical_create_subscriber.c:1118: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). PQescapeLiteral(conn, provider_dsn, strlen(provider_dsn)), data/pglogical-2.3.3/pglogical_create_subscriber.c:1164: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(name) == 0) data/pglogical-2.3.3/pglogical_create_subscriber.c:1167: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(name) > NAMEDATALEN) data/pglogical-2.3.3/pglogical_create_subscriber.c:1331:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &ControlFile, sizeof(ControlFileData)) != sizeof(ControlFileData)) data/pglogical-2.3.3/pglogical_create_subscriber.c:1643:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nbytes = read(srcfd, buffer, COPY_BUF_SIZE); data/pglogical-2.3.3/pglogical_dump/compress_io.c:650:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = fgetc(fp->uncompressedfp); data/pglogical-2.3.3/pglogical_dump/compress_io.c:711:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int filenamelen = strlen(filename); data/pglogical-2.3.3/pglogical_dump/compress_io.c:712: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 suffixlen = strlen(suffix); data/pglogical-2.3.3/pglogical_dump/dumputils.c:195:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t length = strlen(str); data/pglogical-2.3.3/pglogical_dump/dumputils.c:272:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t length = strlen(str); data/pglogical-2.3.3/pglogical_dump/dumputils.c:421:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). inputlen = strlen(atext); data/pglogical-2.3.3/pglogical_dump/dumputils.c:515: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(acls) == 0) data/pglogical-2.3.3/pglogical_dump/dumputils.c:631:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen("group ")) == 0) data/pglogical-2.3.3/pglogical_dump/dumputils.c:633: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). fmtId(grantee->data + strlen("group "))); data/pglogical-2.3.3/pglogical_dump/dumputils.c:644:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen("group ")) == 0) data/pglogical-2.3.3/pglogical_dump/dumputils.c:646: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). fmtId(grantee->data + strlen("group "))); data/pglogical-2.3.3/pglogical_dump/dumputils.c:1221: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). pg_malloc(sizeof(SimpleStringListCell) + strlen(val)); data/pglogical-2.3.3/pglogical_dump/kwlookup.c:49:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(text); data/pglogical-2.3.3/pglogical_dump/parallel.c:65:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define piperead(a,b,c) read(a,b,c) data/pglogical-2.3.3/pglogical_dump/parallel.c:107:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strncmp(msg, prefix, strlen(prefix)) == 0) data/pglogical-2.3.3/pglogical_dump/parallel.c:221: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). vsnprintf(buf + strlen("ERROR "), data/pglogical-2.3.3/pglogical_dump/parallel.c:222: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). sizeof(buf) - strlen("ERROR "), fmt, ap); data/pglogical-2.3.3/pglogical_dump/parallel.c:879: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). sscanf(command + strlen("DUMP "), "%d%n", &dumpId, &nBytes); data/pglogical-2.3.3/pglogical_dump/parallel.c:880: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). Assert(nBytes == strlen(command) - strlen("DUMP ")); data/pglogical-2.3.3/pglogical_dump/parallel.c:880: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). Assert(nBytes == strlen(command) - strlen("DUMP ")); data/pglogical-2.3.3/pglogical_dump/parallel.c:909: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). sscanf(command + strlen("RESTORE "), "%d%n", &dumpId, &nBytes); data/pglogical-2.3.3/pglogical_dump/parallel.c:910: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). Assert(nBytes == strlen(command) - strlen("RESTORE ")); data/pglogical-2.3.3/pglogical_dump/parallel.c:910: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). Assert(nBytes == strlen(command) - strlen("RESTORE ")); data/pglogical-2.3.3/pglogical_dump/parallel.c:972: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). statusString = msg + strlen("OK RESTORE "); data/pglogical-2.3.3/pglogical_dump/parallel.c:979: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). statusString = msg + strlen("OK DUMP "); data/pglogical-2.3.3/pglogical_dump/parallel.c:992:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). exit_horribly(modulename, "%s", msg + strlen("ERROR ")); data/pglogical-2.3.3/pglogical_dump/parallel.c:1112: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). int len = strlen(str) + 1; data/pglogical-2.3.3/pglogical_dump/parallel.c:1242: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). int len = strlen(str) + 1; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:491:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mark + strlen(buffer)); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:628:46: [1] (buffer) strlen: Does not handle 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 (!ropt->dataOnly && te->defn != NULL && strlen(te->defn) != 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:630: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). else if (te->copyStmt != NULL && strlen(te->copyStmt) != 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:763:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (te->copyStmt && strlen(te->copyStmt) > 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1212: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). buflen = strlen(buf); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1226: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). if (strspn(buf, " \t\r\n") == strlen(buf)) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1275: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). WriteData(AH, s, strlen(s)); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1863: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(c); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1978:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&AH->lookahead[0], sig, 5); data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1990:19: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byteread = fgetc(fh)) == EOF) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:1995:19: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byteread = fgetc(fh)) == EOF) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2007:20: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byteread = fgetc(fh)) == EOF) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2019:22: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((AH->intSize = fgetc(fh)) == EOF) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2025:23: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((AH->offSize = fgetc(fh)) == EOF) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2032:19: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((byteread = fgetc(fh)) == EOF) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2048: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). if (AH->lookaheadLen >= strlen(TEXT_DUMPALL_HEADER) && data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2049:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strncmp(AH->lookahead, TEXT_DUMP_HEADER, strlen(TEXT_DUMP_HEADER)) == 0 || data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2050: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). strncmp(AH->lookahead, TEXT_DUMPALL_HEADER, strlen(TEXT_DUMPALL_HEADER)) == 0)) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:2661: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). if (!te->defn || strlen(te->defn) == 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:3055: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). last = first + strlen(first) - 1; data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:3193: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(te->defn) > 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:3204:3: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(te->owner) > 0 && strlen(te->dropStmt) > 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_archiver.c:3204: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). strlen(te->owner) > 0 && strlen(te->dropStmt) > 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:636:8: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). res = getc(AH->FH); data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:875:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). Assert(nBytes == strlen(str)); data/pglogical-2.3.3/pglogical_dump/pg_backup_custom.c:940:9: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). byt = getc(AH->FH); data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:122:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!requser || strlen(requser) == 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_db.c:419:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(errStmt, qry, DB_MAX_ERR_STMT); data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:300: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(tctx->filename) == 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:718: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(dname) + 1 + strlen(relativeFilename) + 1 > MAXPGPATH) data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:718:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(dname) + 1 + strlen(relativeFilename) + 1 > MAXPGPATH) data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:722:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(buf, "/"); data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:864: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). Assert(nBytes == strlen(str)); data/pglogical-2.3.3/pglogical_dump/pg_backup_directory.c:871: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). Assert(nBytes == strlen(str)); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:308:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(ctx->filename) == 0) data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:386:15: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). old_umask = umask(S_IRWXG | S_IRWXO); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:422:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(old_umask); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:508:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(s); data/pglogical-2.3.3/pglogical_dump/pg_backup_tar.c:690: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). pos1 = (int) strlen(te->copyStmt) - 13; data/pglogical-2.3.3/pglogical_dump/pg_dump.c:1482: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(column_list) > 2) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:1727:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strspn(s, "0123456789 +-eE.") == strlen(s)) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2332: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(encoding) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2337: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(collate) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2342: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(ctype) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2347: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(tablespace) > 0 && strcmp(tablespace, "pg_default") != 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2487:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (comment && strlen(comment)) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:2525: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(seclabelQry->data)) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:3086: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(nsinfo[i].rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:3479: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(tyinfo[i].rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:3590: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(oprinfo[i].rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:3849: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(opcinfo[i].rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:3937: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(opfinfo[i].rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4075: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(agginfo[i].aggfn.rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4256: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(finfo[i].rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:4875: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(tblinfo[i].rolname) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:7969: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(nspinfo->dobj.name) == 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:8085: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(extinfo->extconfig) > 2) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:8090: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(extinfo->extcondition) > 2) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:10832: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(opcfamilyname) > 0 && data/pglogical-2.3.3/pglogical_dump/pg_dump.c:10953: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(sortfamily) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:11311: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(sortfamily) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:12388: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(fdwinfo->fdwoptions) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:12467:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (srvinfo->srvtype && strlen(srvinfo->srvtype) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:12472:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (srvinfo->srvversion && strlen(srvinfo->srvversion) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:12481:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (srvinfo->srvoptions && strlen(srvinfo->srvoptions) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:12598: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). if (umoptions && strlen(umoptions) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:13222:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (tbinfo->reloptions && strlen(tbinfo->reloptions) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:13467: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). if ((tbinfo->reloptions && strlen(tbinfo->reloptions) > 0) || data/pglogical-2.3.3/pglogical_dump/pg_dump.c:13468: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). (tbinfo->toast_reloptions && strlen(tbinfo->toast_reloptions) > 0)) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:13473: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). if (tbinfo->reloptions && strlen(tbinfo->reloptions) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:13478:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (tbinfo->toast_reloptions && strlen(tbinfo->toast_reloptions) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:14055:29: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (indxinfo->options && strlen(indxinfo->options) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:14690:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t tlen = strlen(p); data/pglogical-2.3.3/pglogical_dump/pg_dump.c:14916: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). if (rinfo->reloptions && strlen(rinfo->reloptions) > 0) data/pglogical-2.3.3/pglogical_dump/pg_dump.c:15174:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(extconditionarray[j]) > 0) data/pglogical-2.3.3/pglogical_dump/tar.c:126:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int flen = strlen(filename); data/pglogical-2.3.3/pglogical_fe.c:39: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). snprintf(retpath + strlen(retpath), MAXPGPATH - strlen(retpath), data/pglogical-2.3.3/pglogical_fe.c:39:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(retpath + strlen(retpath), MAXPGPATH - strlen(retpath), data/pglogical-2.3.3/pglogical_node.c:112: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(name) == 0) data/pglogical-2.3.3/pglogical_node.c:117: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(name) >= NAMEDATALEN) data/pglogical-2.3.3/pglogical_node.c:159:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(node->name))); data/pglogical-2.3.3/pglogical_node.c:479: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). strlen(nodeif->name))); data/pglogical-2.3.3/pglogical_node.c:707: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). strlen(sub->name))); data/pglogical-2.3.3/pglogical_output_plugin.c:300:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). && strlen(data->client_expected_encoding) != 0) data/pglogical-2.3.3/pglogical_proto_json.c:389:52: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!key_scalar && IsValidJsonNumber(outputstr, strlen(outputstr))) data/pglogical-2.3.3/pglogical_proto_native.c:79: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). nspnamelen = strlen(nspname) + 1; data/pglogical-2.3.3/pglogical_proto_native.c:82: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). relnamelen = strlen(relname) + 1; data/pglogical-2.3.3/pglogical_proto_native.c:153:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(attname) + 1; data/pglogical-2.3.3/pglogical_proto_native.c:211: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). Assert(strlen(origin) < 255); data/pglogical-2.3.3/pglogical_proto_native.c:222: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(origin) + 1; data/pglogical-2.3.3/pglogical_proto_native.c:486: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). len = strlen(outputstr) + 1; data/pglogical-2.3.3/pglogical_repset.c:656: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(repset->name) == 0) data/pglogical-2.3.3/pglogical_repset.c:673: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). strlen(repset->name))); data/pglogical-2.3.3/pglogical_rpc.c:58: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). PQescapeLiteral(conn, repset_name, strlen(repset_name))); data/pglogical-2.3.3/pglogical_rpc.c:125:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). PQescapeIdentifier(conn, rv->schemaname, strlen(rv->schemaname)), data/pglogical-2.3.3/pglogical_rpc.c:126:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). PQescapeIdentifier(conn, rv->relname, strlen(rv->relname))); data/pglogical-2.3.3/pglogical_rpc.c:139: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). PQescapeLiteral(conn, repset_name, strlen(repset_name))); data/pglogical-2.3.3/pglogical_rpc.c:352: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). PQescapeLiteral(conn, argname, strlen(argname))); data/pglogical-2.3.3/pglogical_sync.c:258: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). s = PQescapeLiteral(conn, snapshot, strlen(snapshot)); data/pglogical-2.3.3/pglogical_sync.c:293: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). s = PQescapeLiteral(conn, origin_name, strlen(origin_name)); data/pglogical-2.3.3/pglogical_sync.c:429: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). strlen(attname))); data/pglogical-2.3.3/pglogical_sync.c:452: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). strlen(remoterel->nspname)), data/pglogical-2.3.3/pglogical_sync.c:454: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). strlen(remoterel->relname))); data/pglogical-2.3.3/pglogical_sync.c:469:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(repset_name))); data/pglogical-2.3.3/pglogical_sync.c:484: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). strlen(remoterel->nspname)), data/pglogical-2.3.3/pglogical_sync.c:486: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). strlen(remoterel->relname))); data/pglogical-2.3.3/pglogical_sync.c:508:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(remoterel->nspname)), data/pglogical-2.3.3/pglogical_sync.c:510:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(remoterel->relname))); data/pglogical-2.3.3/pglogical_sync.c:1103:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(tablename)))); ANALYSIS SUMMARY: Hits = 401 Lines analyzed = 57219 in approximately 1.33 seconds (42894 lines/second) Physical Source Lines of Code (SLOC) = 38247 Hits@level = [0] 195 [1] 171 [2] 188 [3] 5 [4] 37 [5] 0 Hits@level+ = [0+] 596 [1+] 401 [2+] 230 [3+] 42 [4+] 37 [5+] 0 Hits/KSLOC@level+ = [0+] 15.5829 [1+] 10.4845 [2+] 6.01354 [3+] 1.09813 [4+] 0.967396 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.