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/pg-repack-1.4.6/bin/pg_repack.c Examining data/pg-repack-1.4.6/bin/pgut/pgut-fe.c Examining data/pg-repack-1.4.6/bin/pgut/pgut-fe.h Examining data/pg-repack-1.4.6/bin/pgut/pgut.c Examining data/pg-repack-1.4.6/bin/pgut/pgut.h Examining data/pg-repack-1.4.6/lib/pgut/pgut-be.h Examining data/pg-repack-1.4.6/lib/pgut/pgut-spi.c Examining data/pg-repack-1.4.6/lib/pgut/pgut-spi.h Examining data/pg-repack-1.4.6/lib/repack.c FINAL RESULTS: data/pg-repack-1.4.6/bin/pg_repack.c:1283:2: [5] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(buffer, PQgetvalue(res, 0, 0), sizeof(buffer) - 1); data/pg-repack-1.4.6/bin/pgut/pgut.c:395: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/pg-repack-1.4.6/bin/pgut/pgut.c:1273:13: [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. nprinted = vsnprintf(str->data + str->len, avail, fmt, args); data/pg-repack-1.4.6/bin/pgut/pgut.h:106:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))); data/pg-repack-1.4.6/bin/pgut/pgut.h:158:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 0))); data/pg-repack-1.4.6/lib/pgut/pgut-spi.c:19:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 0))); data/pg-repack-1.4.6/lib/pgut/pgut-spi.h:22:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))); data/pg-repack-1.4.6/lib/pgut/pgut-spi.h:25:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 7))); data/pg-repack-1.4.6/bin/pg_repack.c:1125:28: [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 *appname = getenv("PGAPPNAME"); data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:234:16: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((value = getenv(name)) != NULL) data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:779: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, optstring, longopts, &optindex)) != -1) data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:788:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. (dbname = getenv("PGDATABASE")) || data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:789:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. (dbname = getenv("PGUSER")) || data/pg-repack-1.4.6/bin/pgut/pgut.c:83:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("PGAPPNAME") == NULL) data/pg-repack-1.4.6/bin/pgut/pgut.c:1096:2: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&cancelConnLock); data/pg-repack-1.4.6/bin/pgut/pgut.c:1129:2: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&cancelConnLock); data/pg-repack-1.4.6/bin/pgut/pgut.c:1617:3: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. EnterCriticalSection(&cancelConnLock); data/pg-repack-1.4.6/bin/pgut/pgut.c:1630:2: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. InitializeCriticalSection(&cancelConnLock); data/pg-repack-1.4.6/bin/pg_repack.c:263: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(buffer, "%u", value); data/pg-repack-1.4.6/bin/pg_repack.c:294:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[256]; data/pg-repack-1.4.6/bin/pg_repack.c:432: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 *params[1]; data/pg-repack-1.4.6/bin/pg_repack.c:495: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[64]; data/pg-repack-1.4.6/bin/pg_repack.c:582: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 errbuf[256]; data/pg-repack-1.4.6/bin/pg_repack.c:872: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 *params[6]; data/pg-repack-1.4.6/bin/pg_repack.c:873:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[12]; data/pg-repack-1.4.6/bin/pg_repack.c:885:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). result = atoi(PQgetvalue(res, 0, 0)); data/pg-repack-1.4.6/bin/pg_repack.c:1111: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 *params[3]; data/pg-repack-1.4.6/bin/pg_repack.c:1114:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[12]; data/pg-repack-1.4.6/bin/pg_repack.c:1118: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 *indexparams[2]; data/pg-repack-1.4.6/bin/pg_repack.c:1119:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char indexbuffer[12]; data/pg-repack-1.4.6/bin/pg_repack.c:1719: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 *params[2]; data/pg-repack-1.4.6/bin/pg_repack.c:1767: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 sql[1024]; data/pg-repack-1.4.6/bin/pg_repack.c:1858: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 *params[2]; data/pg-repack-1.4.6/bin/pg_repack.c:1859:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[12]; data/pg-repack-1.4.6/bin/pg_repack.c:1860:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char num_buff[12]; data/pg-repack-1.4.6/bin/pg_repack.c:1890: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 buffer[12]; data/pg-repack-1.4.6/bin/pg_repack.c:1891: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 num_buff[12]; data/pg-repack-1.4.6/bin/pg_repack.c:1892: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 *params[2]; data/pg-repack-1.4.6/bin/pg_repack.c:1916:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[2][12]; data/pg-repack-1.4.6/bin/pg_repack.c:1917: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 *create_idx, *schema_name, *table_name, *params[3]; data/pg-repack-1.4.6/bin/pg_repack.c:2108: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 *params[1]; data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:216: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 name[256]; data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:383:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:384:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char key[1024]; data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:385:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char value[1024]; data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:509:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, s, j); data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:655: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 username[128]; /* remains after function execute */ data/pg-repack-1.4.6/bin/pgut/pgut.c:94:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/pg-repack-1.4.6/bin/pgut/pgut.c:342:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char junk[2]; data/pg-repack-1.4.6/bin/pgut/pgut.c:446: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, passwdbuf, sizeof(char)*BUFSIZE); data/pg-repack-1.4.6/bin/pgut/pgut.c:451: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(passwdbuf, buf, sizeof(char)*BUFSIZE); data/pg-repack-1.4.6/bin/pgut/pgut.c:456: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, passwdbuf, sizeof(char)*BUFSIZE); data/pg-repack-1.4.6/bin/pgut/pgut.c:462: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(passwdbuf, buf, sizeof(char)*BUFSIZE); data/pg-repack-1.4.6/bin/pgut/pgut.c:1164: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[256]; data/pg-repack-1.4.6/bin/pgut/pgut.c:1390: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(r, str, len); data/pg-repack-1.4.6/bin/pgut/pgut.c:1421:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[16]; data/pg-repack-1.4.6/bin/pgut/pgut.c:1431:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fp = fopen(path, mode)) == NULL) data/pg-repack-1.4.6/bin/pgut/pgut.c:1439: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 dir[MAXPGPATH]; data/pg-repack-1.4.6/bin/pgut/pgut.c:1687: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(&save_readfds, readfds, sizeof(fd_set)); data/pg-repack-1.4.6/bin/pgut/pgut.c:1689: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(&save_writefds, writefds, sizeof(fd_set)); data/pg-repack-1.4.6/bin/pgut/pgut.c:1691: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(&save_exceptfds, exceptfds, sizeof(fd_set)); data/pg-repack-1.4.6/bin/pgut/pgut.c:1710: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(readfds, &save_readfds, sizeof(fd_set)); data/pg-repack-1.4.6/bin/pgut/pgut.c:1712: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(writefds, &save_writefds, sizeof(fd_set)); data/pg-repack-1.4.6/bin/pgut/pgut.c:1714: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(exceptfds, &save_exceptfds, sizeof(fd_set)); data/pg-repack-1.4.6/bin/pgut/pgut.h:182:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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/pg-repack-1.4.6/lib/pgut/pgut-spi.c:85:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char c_nulls[FUNC_MAX_ARGS]; data/pg-repack-1.4.6/lib/repack.c:244: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 nulls_peek[1] = { 0 }; data/pg-repack-1.4.6/lib/repack.c:384: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). ver = atoi(strver); data/pg-repack-1.4.6/lib/repack.c:933: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 name[NAMEDATALEN]; data/pg-repack-1.4.6/lib/repack.c:949: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 name[NAMEDATALEN]; data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:397: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). for (i = strlen(buf); i > 0 && IsSpace(buf[i - 1]); i--) data/pg-repack-1.4.6/bin/pgut/pgut-fe.c:542:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(key, start, end - start); data/pg-repack-1.4.6/bin/pgut/pgut.c:109: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). return parse_bool_with_len(value, strlen(value), result); data/pg-repack-1.4.6/bin/pgut/pgut.c:345: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). tmp = pgut_malloc(strlen(value) + + 1); data/pg-repack-1.4.6/bin/pgut/pgut.c:359:6: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. i = sscanf(tmp, "%04d %02d %02d %02d %02d %02d%1s", data/pg-repack-1.4.6/bin/pgut/pgut.c:393: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). pgut_malloc(sizeof(SimpleStringListCell) + strlen(val)); data/pg-repack-1.4.6/bin/pgut/pgut.c:884: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(fmt); data/pg-repack-1.4.6/bin/pgut/pgut.c:1052: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(fmt); data/pg-repack-1.4.6/bin/pgut/pgut.c:1326:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(fd, str->data + str->len, str->maxlen - str->len - 1); data/pg-repack-1.4.6/bin/pgut/pgut.c:1405: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(str); data/pg-repack-1.4.6/bin/pgut/pgut.c:1477: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(p) >= 2) data/pg-repack-1.4.6/bin/pgut/pgut.c:1643:1: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(unsigned int usec) data/pg-repack-1.4.6/bin/pgut/pgut.h:204:12: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. extern int usleep(unsigned int usec); data/pg-repack-1.4.6/lib/repack.c:430:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((arg1 && strncmp(sql, arg1, (len = strlen(arg1))) == 0) || data/pg-repack-1.4.6/lib/repack.c:431: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). (arg2 && strncmp(sql, arg2, (len = strlen(arg2))) == 0)) data/pg-repack-1.4.6/lib/repack.c:450: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(what); ANALYSIS SUMMARY: Hits = 86 Lines analyzed = 6704 in approximately 0.18 seconds (37882 lines/second) Physical Source Lines of Code (SLOC) = 4833 Hits@level = [0] 62 [1] 16 [2] 52 [3] 10 [4] 7 [5] 1 Hits@level+ = [0+] 148 [1+] 86 [2+] 70 [3+] 18 [4+] 8 [5+] 1 Hits/KSLOC@level+ = [0+] 30.6228 [1+] 17.7943 [2+] 14.4838 [3+] 3.72439 [4+] 1.65529 [5+] 0.206911 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.